summaryrefslogtreecommitdiffstats
path: root/projecttemplates/WebFormsRelyingParty/Code/OAuthTokenManager.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2009-11-12 23:52:27 -0800
committerAndrew Arnott <andrewarnott@gmail.com>2009-11-12 23:52:27 -0800
commit6c7a41277312bfc42aabf5ecbe5fc58e99243f37 (patch)
treeaa432a97b2c7db8532939fd43c7faccca62e2488 /projecttemplates/WebFormsRelyingParty/Code/OAuthTokenManager.cs
parentf7c578cc7c7713de3348a839d0d9caeba643a33d (diff)
downloadDotNetOpenAuth-6c7a41277312bfc42aabf5ecbe5fc58e99243f37.zip
DotNetOpenAuth-6c7a41277312bfc42aabf5ecbe5fc58e99243f37.tar.gz
DotNetOpenAuth-6c7a41277312bfc42aabf5ecbe5fc58e99243f37.tar.bz2
Fixed a bunch of bugs in the project template's oauth sp implementation.
Diffstat (limited to 'projecttemplates/WebFormsRelyingParty/Code/OAuthTokenManager.cs')
-rw-r--r--projecttemplates/WebFormsRelyingParty/Code/OAuthTokenManager.cs6
1 files changed, 4 insertions, 2 deletions
diff --git a/projecttemplates/WebFormsRelyingParty/Code/OAuthTokenManager.cs b/projecttemplates/WebFormsRelyingParty/Code/OAuthTokenManager.cs
index 79a0b7e..ff757c9 100644
--- a/projecttemplates/WebFormsRelyingParty/Code/OAuthTokenManager.cs
+++ b/projecttemplates/WebFormsRelyingParty/Code/OAuthTokenManager.cs
@@ -103,8 +103,9 @@ namespace WebFormsRelyingParty.Code {
/// </para>
/// </remarks>
public void ExpireRequestTokenAndStoreNewAccessToken(string consumerKey, string requestToken, string accessToken, string accessTokenSecret) {
- var requestTokenEntity = Global.DataContext.IssuedToken.OfType<IssuedRequestToken>().First(
- t => t.Consumer.ConsumerKey == consumerKey && t.Token == requestToken);
+ var requestTokenEntity = Global.DataContext.IssuedToken.OfType<IssuedRequestToken>()
+ .Include("User")
+ .First(t => t.Consumer.ConsumerKey == consumerKey && t.Token == requestToken);
var accessTokenEntity = new IssuedAccessToken {
Token = accessToken,
@@ -113,6 +114,7 @@ namespace WebFormsRelyingParty.Code {
CreatedOn = DateTime.Now,
User = requestTokenEntity.User,
Scope = requestTokenEntity.Scope,
+ Consumer = requestTokenEntity.Consumer,
};
Global.DataContext.DeleteObject(requestTokenEntity);