diff options
4 files changed, 8 insertions, 7 deletions
diff --git a/projecttemplates/WebFormsRelyingParty/Code/OAuthAuthenticationModule.cs b/projecttemplates/WebFormsRelyingParty/Code/OAuthAuthenticationModule.cs index 57d442f..0896154 100644 --- a/projecttemplates/WebFormsRelyingParty/Code/OAuthAuthenticationModule.cs +++ b/projecttemplates/WebFormsRelyingParty/Code/OAuthAuthenticationModule.cs @@ -26,7 +26,7 @@ namespace WebFormsRelyingParty.Code { /// <param name="context">An <see cref="T:System.Web.HttpApplication"/> that provides access to the methods, properties, and events common to all application objects within an ASP.NET application</param> public void Init(HttpApplication context) { this.application = context; - this.application.AuthenticateRequest += new EventHandler(context_AuthenticateRequest); + this.application.AuthenticateRequest += this.context_AuthenticateRequest; } /// <summary> diff --git a/projecttemplates/WebFormsRelyingParty/Code/Utilities.cs b/projecttemplates/WebFormsRelyingParty/Code/Utilities.cs index 8a49703..25d293e 100644 --- a/projecttemplates/WebFormsRelyingParty/Code/Utilities.cs +++ b/projecttemplates/WebFormsRelyingParty/Code/Utilities.cs @@ -12,7 +12,7 @@ namespace WebFormsRelyingParty.Code { using System.Web; public static class Utilities { - private const string csrfCookieName = "CsrfCookie"; + private const string CsrfCookieName = "CsrfCookie"; private static readonly RandomNumberGenerator CryptoRandomDataGenerator = new RNGCryptoServiceProvider(); /// <summary> @@ -38,7 +38,7 @@ namespace WebFormsRelyingParty.Code { string secret = Convert.ToBase64String(randomData); // Send the secret down as a cookie... - var cookie = new HttpCookie(csrfCookieName, secret) { + var cookie = new HttpCookie(CsrfCookieName, secret) { Path = HttpContext.Current.Request.Path, HttpOnly = true, Expires = DateTime.Now.AddMinutes(30), @@ -50,7 +50,7 @@ namespace WebFormsRelyingParty.Code { } public static void VerifyCsrfCookie(string secret) { - var cookie = HttpContext.Current.Request.Cookies[csrfCookieName]; + var cookie = HttpContext.Current.Request.Cookies[CsrfCookieName]; if (cookie != null) { if (cookie.Value == secret && !string.IsNullOrEmpty(secret)) { // Valid CSRF check. Clear the cookie and return. diff --git a/projecttemplates/WebFormsRelyingParty/Members/OAuthAuthorize.aspx.cs b/projecttemplates/WebFormsRelyingParty/Members/OAuthAuthorize.aspx.cs index 2969d7c..f9a520b 100644 --- a/projecttemplates/WebFormsRelyingParty/Members/OAuthAuthorize.aspx.cs +++ b/projecttemplates/WebFormsRelyingParty/Members/OAuthAuthorize.aspx.cs @@ -45,11 +45,11 @@ namespace WebFormsRelyingParty.Members { // The rest of this method only executes if we couldn't automatically // redirect to the consumer. if (pendingRequest.IsUnsafeRequest) { - verifierMultiView.SetActiveView(noCallbackView); + this.verifierMultiView.SetActiveView(noCallbackView); } else { - verifierMultiView.SetActiveView(verificationCodeView); + this.verifierMultiView.SetActiveView(verificationCodeView); string verifier = ServiceProvider.CreateVerificationCode(consumer.VerificationCodeFormat, consumer.VerificationCodeLength); - verificationCodeLabel.Text = verifier; + this.verificationCodeLabel.Text = verifier; requestToken.VerificationCode = verifier; tokenManager.UpdateToken(requestToken); } diff --git a/samples/OAuthServiceProvider/App_Code/Global.cs b/samples/OAuthServiceProvider/App_Code/Global.cs index d32d9a7..10b3cba 100644 --- a/samples/OAuthServiceProvider/App_Code/Global.cs +++ b/samples/OAuthServiceProvider/App_Code/Global.cs @@ -96,6 +96,7 @@ public class Global : HttpApplication { if (!appPath.EndsWith("/")) { appPath += "/"; } + // This will break in IIS Integrated Pipeline mode, since applications // start before the first incoming request context is available. // TODO: fix this. |