summaryrefslogtreecommitdiffstats
path: root/projecttemplates/WebFormsRelyingParty/Code
diff options
context:
space:
mode:
Diffstat (limited to 'projecttemplates/WebFormsRelyingParty/Code')
-rw-r--r--projecttemplates/WebFormsRelyingParty/Code/OAuthAuthenticationModule.cs2
-rw-r--r--projecttemplates/WebFormsRelyingParty/Code/Utilities.cs6
2 files changed, 4 insertions, 4 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.