diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2010-07-06 06:53:13 -0700 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2010-07-06 06:53:13 -0700 |
commit | 9de088f6b539f6d205c01ed405307d59b17fe4f0 (patch) | |
tree | 4f64638c49ddbebbf7d9dc04acf1aded3de37a0f /samples/OAuthServiceProvider/Code/OAuthAuthorizationManager.cs | |
parent | 52a3f817009b1ea7294767b4c045030e138ce170 (diff) | |
download | DotNetOpenAuth-9de088f6b539f6d205c01ed405307d59b17fe4f0.zip DotNetOpenAuth-9de088f6b539f6d205c01ed405307d59b17fe4f0.tar.gz DotNetOpenAuth-9de088f6b539f6d205c01ed405307d59b17fe4f0.tar.bz2 |
Got the OAuthConsumerWpf sample working with Facebook OAuth 2.0 again.
Diffstat (limited to 'samples/OAuthServiceProvider/Code/OAuthAuthorizationManager.cs')
-rw-r--r-- | samples/OAuthServiceProvider/Code/OAuthAuthorizationManager.cs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/samples/OAuthServiceProvider/Code/OAuthAuthorizationManager.cs b/samples/OAuthServiceProvider/Code/OAuthAuthorizationManager.cs index be6d671..41b1d23 100644 --- a/samples/OAuthServiceProvider/Code/OAuthAuthorizationManager.cs +++ b/samples/OAuthServiceProvider/Code/OAuthAuthorizationManager.cs @@ -7,10 +7,14 @@ using System.ServiceModel; using System.ServiceModel.Channels; using System.ServiceModel.Security; + + using DotNetOpenAuth.Messaging; using DotNetOpenAuth.OAuth; using DotNetOpenAuth.OAuth.ChannelElements; using DotNetOpenAuth.OAuth2; + using ProtocolException = System.ServiceModel.ProtocolException; + /// <summary> /// A WCF extension to authenticate incoming messages using OAuth. /// </summary> @@ -23,8 +27,8 @@ return false; } - HttpRequestMessageProperty httpDetails = operationContext.RequestContext.RequestMessage.Properties[HttpRequestMessageProperty.Name] as HttpRequestMessageProperty; - Uri requestUri = operationContext.RequestContext.RequestMessage.Properties["OriginalHttpRequestUri"] as Uri; + var httpDetails = operationContext.RequestContext.RequestMessage.Properties[HttpRequestMessageProperty.Name] as HttpRequestMessageProperty; + var requestUri = operationContext.RequestContext.RequestMessage.Properties["OriginalHttpRequestUri"] as Uri; try { var principal = this.VerifyOAuth2(httpDetails, requestUri); @@ -80,7 +84,7 @@ OAuth2AuthorizationServer.AsymmetricKey)); string username, scope; - var error = resourceServer.VerifyAccess(new DotNetOpenAuth.Messaging.HttpRequestInfo(httpDetails, requestUri), out username, out scope); + var error = resourceServer.VerifyAccess(new HttpRequestInfo(httpDetails, requestUri), out username, out scope); if (error == null) { string[] scopes = scope.Split(new char[] { ' ' }); var principal = new OAuthPrincipal(username, scopes); |