summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.AspNet/Clients/OAuth2/OAuth2Client.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2012-05-01 08:51:13 -0700
committerAndrew Arnott <andrewarnott@gmail.com>2012-05-01 08:51:13 -0700
commitfa7356deb5d07f7ae3fbf0c2a2d887d380371f04 (patch)
tree402454ac7e3c5784fff8a549ffc22510c1314544 /src/DotNetOpenAuth.AspNet/Clients/OAuth2/OAuth2Client.cs
parent01d8c73f818d30b20f86630d35d230b5168215d1 (diff)
parentd5ce85a1441fc9e315c96c6453f42c3f02dd4dbb (diff)
downloadDotNetOpenAuth-fa7356deb5d07f7ae3fbf0c2a2d887d380371f04.zip
DotNetOpenAuth-fa7356deb5d07f7ae3fbf0c2a2d887d380371f04.tar.gz
DotNetOpenAuth-fa7356deb5d07f7ae3fbf0c2a2d887d380371f04.tar.bz2
Merge branch 'v4.0'
Conflicts: nuget/DotNetOpenAuth.AspNet.nuspec nuget/DotNetOpenAuth.Core.UI.nuspec nuget/DotNetOpenAuth.Core.nuspec nuget/DotNetOpenAuth.InfoCard.UI.nuspec nuget/DotNetOpenAuth.InfoCard.nuspec nuget/DotNetOpenAuth.OAuth.Common.nuspec nuget/DotNetOpenAuth.OAuth.Consumer.nuspec nuget/DotNetOpenAuth.OAuth.ServiceProvider.nuspec nuget/DotNetOpenAuth.OAuth.nuspec nuget/DotNetOpenAuth.OAuth2.AuthorizationServer.nuspec nuget/DotNetOpenAuth.OAuth2.Client.UI.nuspec nuget/DotNetOpenAuth.OAuth2.Client.nuspec nuget/DotNetOpenAuth.OAuth2.ResourceServer.nuspec nuget/DotNetOpenAuth.OAuth2.nuspec nuget/DotNetOpenAuth.OpenId.Provider.UI.nuspec nuget/DotNetOpenAuth.OpenId.Provider.nuspec nuget/DotNetOpenAuth.OpenId.RelyingParty.UI.nuspec nuget/DotNetOpenAuth.OpenId.RelyingParty.nuspec nuget/DotNetOpenAuth.OpenId.UI.nuspec nuget/DotNetOpenAuth.OpenId.nuspec nuget/DotNetOpenAuth.OpenIdInfoCard.UI.nuspec nuget/DotNetOpenAuth.OpenIdOAuth.nuspec nuget/nuget.proj src/version.txt
Diffstat (limited to 'src/DotNetOpenAuth.AspNet/Clients/OAuth2/OAuth2Client.cs')
-rw-r--r--src/DotNetOpenAuth.AspNet/Clients/OAuth2/OAuth2Client.cs19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/DotNetOpenAuth.AspNet/Clients/OAuth2/OAuth2Client.cs b/src/DotNetOpenAuth.AspNet/Clients/OAuth2/OAuth2Client.cs
index 016d92e..cac4261 100644
--- a/src/DotNetOpenAuth.AspNet/Clients/OAuth2/OAuth2Client.cs
+++ b/src/DotNetOpenAuth.AspNet/Clients/OAuth2/OAuth2Client.cs
@@ -86,7 +86,20 @@ namespace DotNetOpenAuth.AspNet.Clients {
/// <returns>
/// An instance of <see cref="AuthenticationResult"/> containing authentication result.
/// </returns>
- public virtual AuthenticationResult VerifyAuthentication(HttpContextBase context) {
+ public AuthenticationResult VerifyAuthentication(HttpContextBase context) {
+ Requires.NotNull(this.returnUrl, "this.returnUrl");
+ return VerifyAuthentication(context, this.returnUrl);
+ }
+
+ /// <summary>
+ /// Check if authentication succeeded after user is redirected back from the service provider.
+ /// </summary>
+ /// <param name="context">The context.</param>
+ /// <param name="returnPageUrl">The return URL which should match the value passed to RequestAuthentication() method.</param>
+ /// <returns>
+ /// An instance of <see cref="AuthenticationResult"/> containing authentication result.
+ /// </returns>
+ public virtual AuthenticationResult VerifyAuthentication(HttpContextBase context, Uri returnPageUrl) {
Requires.NotNull(context, "context");
string code = context.Request.QueryString["code"];
@@ -94,7 +107,7 @@ namespace DotNetOpenAuth.AspNet.Clients {
return AuthenticationResult.Failed;
}
- string accessToken = this.QueryAccessToken(this.returnUrl, code);
+ string accessToken = this.QueryAccessToken(returnPageUrl, code);
if (accessToken == null) {
return AuthenticationResult.Failed;
}
@@ -133,7 +146,7 @@ namespace DotNetOpenAuth.AspNet.Clients {
/// <returns>
/// An absolute URL.
/// </returns>
- [SuppressMessage("Microsoft.Naming", "CA1726:UsePreferredTerms", MessageId = "Login",
+ [SuppressMessage("Microsoft.Naming", "CA1726:UsePreferredTerms", MessageId = "Login",
Justification = "Login is used more consistently in ASP.Net")]
protected abstract Uri GetServiceLoginUrl(Uri returnUrl);