summaryrefslogtreecommitdiffstats
path: root/projecttemplates/WebFormsRelyingParty/Code/OAuthServiceProvider.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/OAuthServiceProvider.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/OAuthServiceProvider.cs')
-rw-r--r--projecttemplates/WebFormsRelyingParty/Code/OAuthServiceProvider.cs8
1 files changed, 5 insertions, 3 deletions
diff --git a/projecttemplates/WebFormsRelyingParty/Code/OAuthServiceProvider.cs b/projecttemplates/WebFormsRelyingParty/Code/OAuthServiceProvider.cs
index 2c7126f..b914315 100644
--- a/projecttemplates/WebFormsRelyingParty/Code/OAuthServiceProvider.cs
+++ b/projecttemplates/WebFormsRelyingParty/Code/OAuthServiceProvider.cs
@@ -68,7 +68,7 @@ namespace WebFormsRelyingParty.Code {
throw new InvalidOperationException();
}
- return Global.DataContext.IssuedToken.OfType<IssuedRequestToken>().First(t => t.Token == message.Token).Consumer;
+ return Global.DataContext.IssuedToken.OfType<IssuedRequestToken>().Include("Consumer").First(t => t.Token == message.Token).Consumer;
}
}
@@ -82,9 +82,11 @@ namespace WebFormsRelyingParty.Code {
var token = Global.DataContext.IssuedToken.OfType<IssuedRequestToken>().First(t => t.Token == msg.Token);
token.Authorize();
- var response = serviceProvider.PrepareAuthorizationResponse(pendingRequest);
- serviceProvider.Channel.Send(response);
PendingAuthorizationRequest = null;
+ var response = serviceProvider.PrepareAuthorizationResponse(pendingRequest);
+ if (response != null) {
+ serviceProvider.Channel.Send(response);
+ }
}
/// <summary>