diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2009-06-08 06:00:14 -0700 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2009-06-08 06:00:14 -0700 |
commit | 67d4881942b6a145d299a8a32eee8f50ae09cc70 (patch) | |
tree | 587a6ef25d0689ac8455421e0c029a0723f3cc16 /samples/OAuthServiceProvider/Members/Authorize.aspx.cs | |
parent | e55d4a900b4c42ff37f449800d49b7972016e587 (diff) | |
download | DotNetOpenAuth-67d4881942b6a145d299a8a32eee8f50ae09cc70.zip DotNetOpenAuth-67d4881942b6a145d299a8a32eee8f50ae09cc70.tar.gz DotNetOpenAuth-67d4881942b6a145d299a8a32eee8f50ae09cc70.tar.bz2 |
OAuth SP now works with 1.0 Consumers correctly.
Diffstat (limited to 'samples/OAuthServiceProvider/Members/Authorize.aspx.cs')
-rw-r--r-- | samples/OAuthServiceProvider/Members/Authorize.aspx.cs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/samples/OAuthServiceProvider/Members/Authorize.aspx.cs b/samples/OAuthServiceProvider/Members/Authorize.aspx.cs index b3094c9..e396017 100644 --- a/samples/OAuthServiceProvider/Members/Authorize.aspx.cs +++ b/samples/OAuthServiceProvider/Members/Authorize.aspx.cs @@ -37,6 +37,8 @@ public partial class Authorize : System.Web.UI.Page { CryptoRandomDataGenerator.GetBytes(randomData); this.AuthorizationSecret = Convert.ToBase64String(randomData); OAuthAuthorizationSecToken.Value = this.AuthorizationSecret; + + OAuth10ConsumerWarning.Visible = Global.PendingOAuthAuthorization.IsUnsafeRequest; } } } @@ -54,6 +56,15 @@ public partial class Authorize : System.Web.UI.Page { var response = sp.PrepareAuthorizationResponse(pending); if (response != null) { sp.Channel.Send(response); + } else { + if (pending.IsUnsafeRequest) { + verifierMultiView.ActiveViewIndex = 1; + } else { + string verifier = ServiceProvider.CreateVerificationCode(VerificationCodeFormat.AlphaNumericNoLookAlikes, 10); + verificationCodeLabel.Text = verifier; + ITokenContainingMessage requestTokenMessage = pending; + Global.TokenManager.SetRequestTokenVerifier(requestTokenMessage.Token, verifier); + } } } |