diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2009-06-15 15:08:24 -0700 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2009-06-15 15:08:24 -0700 |
commit | e93faf90701f5bd7376535b32b92f059552b17b5 (patch) | |
tree | 904f79a1ad8ddfa288bc58f2d8c45a890162b044 /samples/OAuthServiceProvider/Members/Authorize.aspx.cs | |
parent | 70dcf0ab0a29ab3f0383303cbd1db80b1454b9a7 (diff) | |
parent | b6ca73ea7ee62ef7dd112ddbd77b606684508fa4 (diff) | |
download | DotNetOpenAuth-e93faf90701f5bd7376535b32b92f059552b17b5.zip DotNetOpenAuth-e93faf90701f5bd7376535b32b92f059552b17b5.tar.gz DotNetOpenAuth-e93faf90701f5bd7376535b32b92f059552b17b5.tar.bz2 |
Merge branch 'oauth10a' into v3.0
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..f936c60 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.GetRequestToken(requestTokenMessage.Token).VerificationCode = verifier; + } } } |