summaryrefslogtreecommitdiffstats
path: root/samples/ServiceProvider/App_Code/OAuthAuthorizationManager.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2008-10-06 08:04:30 -0700
committerAndrew <andrewarnott@gmail.com>2008-10-06 08:04:30 -0700
commitf367f68a81e06dcab56348c85f7c09526123c916 (patch)
treec06ead228b7eb588ab783025ed05f816f5af5ee4 /samples/ServiceProvider/App_Code/OAuthAuthorizationManager.cs
parent5e8d26c757a32e3c0237b447d142a3de071fa992 (diff)
downloadDotNetOpenAuth-f367f68a81e06dcab56348c85f7c09526123c916.zip
DotNetOpenAuth-f367f68a81e06dcab56348c85f7c09526123c916.tar.gz
DotNetOpenAuth-f367f68a81e06dcab56348c85f7c09526123c916.tar.bz2
WCF OAuth sample now has 'real' database and login.
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;
}