summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.AspNet/Clients
diff options
context:
space:
mode:
Diffstat (limited to 'src/DotNetOpenAuth.AspNet/Clients')
-rw-r--r--src/DotNetOpenAuth.AspNet/Clients/OAuth/DotNetOpenAuthWebConsumer.cs25
-rw-r--r--src/DotNetOpenAuth.AspNet/Clients/OAuth/OAuthClient.cs2
-rw-r--r--src/DotNetOpenAuth.AspNet/Clients/OAuth/TwitterClient.cs4
-rw-r--r--src/DotNetOpenAuth.AspNet/Clients/OAuth2/FacebookClient.cs2
-rw-r--r--src/DotNetOpenAuth.AspNet/Clients/OAuth2/FacebookGraphData.cs2
5 files changed, 32 insertions, 3 deletions
diff --git a/src/DotNetOpenAuth.AspNet/Clients/OAuth/DotNetOpenAuthWebConsumer.cs b/src/DotNetOpenAuth.AspNet/Clients/OAuth/DotNetOpenAuthWebConsumer.cs
index 9979d97..9757f30 100644
--- a/src/DotNetOpenAuth.AspNet/Clients/OAuth/DotNetOpenAuthWebConsumer.cs
+++ b/src/DotNetOpenAuth.AspNet/Clients/OAuth/DotNetOpenAuthWebConsumer.cs
@@ -16,7 +16,7 @@ namespace DotNetOpenAuth.AspNet.Clients {
/// <summary>
/// The dot net open auth web consumer.
/// </summary>
- public class DotNetOpenAuthWebConsumer : IOAuthWebWorker {
+ public class DotNetOpenAuthWebConsumer : IOAuthWebWorker, IDisposable {
#region Constants and Fields
/// <summary>
@@ -90,5 +90,28 @@ namespace DotNetOpenAuth.AspNet.Clients {
}
#endregion
+
+ #region IDisposable members
+
+ /// <summary>
+ /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+ /// </summary>
+ /// <filterpriority>2</filterpriority>
+ public void Dispose() {
+ this.Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+
+ #endregion
+
+ /// <summary>
+ /// Releases unmanaged and - optionally - managed resources
+ /// </summary>
+ /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
+ protected virtual void Dispose(bool disposing) {
+ if (disposing) {
+ this._webConsumer.Dispose();
+ }
+ }
}
}
diff --git a/src/DotNetOpenAuth.AspNet/Clients/OAuth/OAuthClient.cs b/src/DotNetOpenAuth.AspNet/Clients/OAuth/OAuthClient.cs
index bae3f82..4152f0a 100644
--- a/src/DotNetOpenAuth.AspNet/Clients/OAuth/OAuthClient.cs
+++ b/src/DotNetOpenAuth.AspNet/Clients/OAuth/OAuthClient.cs
@@ -6,6 +6,7 @@
namespace DotNetOpenAuth.AspNet.Clients {
using System;
+ using System.Diagnostics.CodeAnalysis;
using System.Web;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.OAuth;
@@ -50,6 +51,7 @@ namespace DotNetOpenAuth.AspNet.Clients {
/// <param name="tokenManager">
/// The token Manager.
/// </param>
+ [SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Justification = "I don't know how to ensure this rule is followed given this API")]
protected OAuthClient(
string providerName, ServiceProviderDescription serviceDescription, IConsumerTokenManager tokenManager)
: this(providerName, new DotNetOpenAuthWebConsumer(serviceDescription, tokenManager)) {}
diff --git a/src/DotNetOpenAuth.AspNet/Clients/OAuth/TwitterClient.cs b/src/DotNetOpenAuth.AspNet/Clients/OAuth/TwitterClient.cs
index 66a6a95..01318b8 100644
--- a/src/DotNetOpenAuth.AspNet/Clients/OAuth/TwitterClient.cs
+++ b/src/DotNetOpenAuth.AspNet/Clients/OAuth/TwitterClient.cs
@@ -79,8 +79,8 @@ namespace DotNetOpenAuth.AspNet.Clients {
string userId = response.ExtraData["user_id"];
string userName = response.ExtraData["screen_name"];
- string profileRequestUrl = "http://api.twitter.com/1/users/show.xml?user_id="
- + MessagingUtilities.EscapeUriDataStringRfc3986(userId);
+ var profileRequestUrl = new Uri("http://api.twitter.com/1/users/show.xml?user_id="
+ + MessagingUtilities.EscapeUriDataStringRfc3986(userId));
var profileEndpoint = new MessageReceivingEndpoint(profileRequestUrl, HttpDeliveryMethods.GetRequest);
HttpWebRequest request = this.WebWorker.PrepareAuthorizedRequest(profileEndpoint, accessToken);
diff --git a/src/DotNetOpenAuth.AspNet/Clients/OAuth2/FacebookClient.cs b/src/DotNetOpenAuth.AspNet/Clients/OAuth2/FacebookClient.cs
index 54661b2..2d12202 100644
--- a/src/DotNetOpenAuth.AspNet/Clients/OAuth2/FacebookClient.cs
+++ b/src/DotNetOpenAuth.AspNet/Clients/OAuth2/FacebookClient.cs
@@ -7,6 +7,7 @@
namespace DotNetOpenAuth.AspNet.Clients {
using System;
using System.Collections.Generic;
+ using System.Diagnostics.CodeAnalysis;
using System.Net;
using System.Web;
using DotNetOpenAuth.Messaging;
@@ -14,6 +15,7 @@ namespace DotNetOpenAuth.AspNet.Clients {
/// <summary>
/// The facebook client.
/// </summary>
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Facebook", Justification = "Brand name")]
public sealed class FacebookClient : OAuth2Client {
#region Constants and Fields
diff --git a/src/DotNetOpenAuth.AspNet/Clients/OAuth2/FacebookGraphData.cs b/src/DotNetOpenAuth.AspNet/Clients/OAuth2/FacebookGraphData.cs
index 53c2797..9ad3eff 100644
--- a/src/DotNetOpenAuth.AspNet/Clients/OAuth2/FacebookGraphData.cs
+++ b/src/DotNetOpenAuth.AspNet/Clients/OAuth2/FacebookGraphData.cs
@@ -7,6 +7,7 @@
namespace DotNetOpenAuth.AspNet.Clients {
using System;
using System.ComponentModel;
+ using System.Diagnostics.CodeAnalysis;
using System.Runtime.Serialization;
/// <summary>
@@ -17,6 +18,7 @@ namespace DotNetOpenAuth.AspNet.Clients {
/// </remarks>
[DataContract]
[EditorBrowsable(EditorBrowsableState.Never)]
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Facebook", Justification = "Brand name")]
public class FacebookGraphData {
#region Public Properties