diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2009-11-10 21:00:37 -0800 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2009-11-10 21:00:37 -0800 |
commit | 6df46c9875f82f5a5f94a082a0b699fde2978d6f (patch) | |
tree | 56df88c1a4fe02a363e5a0d7d087c1947322ab09 /projecttemplates/WebFormsRelyingParty/Members/OAuthAuthorize.aspx.cs | |
parent | 5d4d80b4a83bb9d6af62cc5f6d78f6f7e541e67d (diff) | |
download | DotNetOpenAuth-6df46c9875f82f5a5f94a082a0b699fde2978d6f.zip DotNetOpenAuth-6df46c9875f82f5a5f94a082a0b699fde2978d6f.tar.gz DotNetOpenAuth-6df46c9875f82f5a5f94a082a0b699fde2978d6f.tar.bz2 |
Added a bunch more OAuth SP supporting code, but it's not done yet.
Diffstat (limited to 'projecttemplates/WebFormsRelyingParty/Members/OAuthAuthorize.aspx.cs')
-rw-r--r-- | projecttemplates/WebFormsRelyingParty/Members/OAuthAuthorize.aspx.cs | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/projecttemplates/WebFormsRelyingParty/Members/OAuthAuthorize.aspx.cs b/projecttemplates/WebFormsRelyingParty/Members/OAuthAuthorize.aspx.cs new file mode 100644 index 0000000..4ffb9b8 --- /dev/null +++ b/projecttemplates/WebFormsRelyingParty/Members/OAuthAuthorize.aspx.cs @@ -0,0 +1,41 @@ +//----------------------------------------------------------------------- +// <copyright file="OAuthAuthorize.aspx.cs" company="Andrew Arnott"> +// Copyright (c) Andrew Arnott. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +namespace WebFormsRelyingParty.Members { + using System; + using System.Collections.Generic; + using System.Linq; + using System.Web; + using System.Web.UI; + using System.Web.UI.WebControls; + using DotNetOpenAuth.OAuth; + using DotNetOpenAuth.OAuth.Messages; + using WebFormsRelyingParty.Code; + + public partial class OAuthAuthorize : System.Web.UI.Page { + protected void Page_Load(object sender, EventArgs e) { + if (!IsPostBack) { + if (OAuthServiceProvider.PendingAuthorizationRequest == null) { + Response.Redirect("~/"); + } + + this.csrfCheck.Value = Utilities.SetCsrfCookie(); + this.consumerNameLabel.Text = HttpUtility.HtmlEncode(OAuthServiceProvider.PendingAuthorizationConsumer.Name); + } else { + Utilities.VerifyCsrfCookie(this.csrfCheck.Value); + } + } + + protected void yesButton_Click(object sender, EventArgs e) { + OAuthServiceProvider.AuthorizePendingRequestToken(); + } + + protected void noButton_Click(object sender, EventArgs e) { + OAuthServiceProvider.PendingAuthorizationRequest = null; + Response.Redirect("~/"); + } + } +} |