summaryrefslogtreecommitdiffstats
path: root/samples/ServiceProvider/App_Code/OAuthAuthorizationManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'samples/ServiceProvider/App_Code/OAuthAuthorizationManager.cs')
-rw-r--r--samples/ServiceProvider/App_Code/OAuthAuthorizationManager.cs5
1 files changed, 3 insertions, 2 deletions
diff --git a/samples/ServiceProvider/App_Code/OAuthAuthorizationManager.cs b/samples/ServiceProvider/App_Code/OAuthAuthorizationManager.cs
index a53e6b9..2b4e06b 100644
--- a/samples/ServiceProvider/App_Code/OAuthAuthorizationManager.cs
+++ b/samples/ServiceProvider/App_Code/OAuthAuthorizationManager.cs
@@ -1,4 +1,5 @@
using System;
+using System.Linq;
using System.ServiceModel;
using System.ServiceModel.Channels;
using DotNetOAuth;
@@ -20,8 +21,8 @@ public class OAuthAuthorizationManager : ServiceAuthorizationManager {
ServiceProvider sp = Constants.CreateServiceProvider();
var auth = sp.GetProtectedResourceAuthorization(httpDetails, requestUri);
if (auth != null) {
- operationContext.IncomingMessageProperties["OAuthConsumerKey"] = auth.ConsumerKey;
- operationContext.IncomingMessageProperties["OAuthAccessToken"] = auth.AccessToken;
+ var accessToken = Global.DataContext.OAuthTokens.Single(token => token.Token == auth.AccessToken);
+ operationContext.IncomingMessageProperties["OAuthAccessToken"] = accessToken;
return true;
}