summaryrefslogtreecommitdiffstats
path: root/samples/OAuthServiceProvider/Members/Authorize.aspx.cs
diff options
context:
space:
mode:
Diffstat (limited to 'samples/OAuthServiceProvider/Members/Authorize.aspx.cs')
-rw-r--r--samples/OAuthServiceProvider/Members/Authorize.aspx.cs11
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;
+ }
}
}