summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.AspNet/Clients/OAuth2/OAuth2Client.cs
diff options
context:
space:
mode:
authorMicrosoft <aspnet@microsoft.com>2012-04-27 12:07:17 -0700
committerdotnetjunky <me@yahoo.com>2012-04-27 17:04:03 -0700
commite7eeb7b5790f04ed1bb8fc9ee137e58789af0a83 (patch)
tree67f42224344fcda0fd18de976e5c237b8b4de058 /src/DotNetOpenAuth.AspNet/Clients/OAuth2/OAuth2Client.cs
parenta6aea8aeeb82e3d35c132e6d09c9cb572efd823d (diff)
downloadDotNetOpenAuth-e7eeb7b5790f04ed1bb8fc9ee137e58789af0a83.zip
DotNetOpenAuth-e7eeb7b5790f04ed1bb8fc9ee137e58789af0a83.tar.gz
DotNetOpenAuth-e7eeb7b5790f04ed1bb8fc9ee137e58789af0a83.tar.bz2
Make changes to OAuth and OpenID to allow web-farm scenario.
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);