diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2012-03-01 23:06:06 -0800 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2012-03-01 23:19:28 -0800 |
commit | 8b88373edc300ba26f260dc80d4ebdf1b4aca2fb (patch) | |
tree | dc3afd50446d9872a56792cd55e7873b83efa7db /src/DotNetOpenAuth.AspNet/OpenAuthAuthenticationTicketHelper.cs | |
parent | 198bffe042a3650095b27bed29d0f8c98bc5c926 (diff) | |
download | DotNetOpenAuth-8b88373edc300ba26f260dc80d4ebdf1b4aca2fb.zip DotNetOpenAuth-8b88373edc300ba26f260dc80d4ebdf1b4aca2fb.tar.gz DotNetOpenAuth-8b88373edc300ba26f260dc80d4ebdf1b4aca2fb.tar.bz2 |
Replaced manual argument validation with helper methods.
Diffstat (limited to 'src/DotNetOpenAuth.AspNet/OpenAuthAuthenticationTicketHelper.cs')
-rw-r--r-- | src/DotNetOpenAuth.AspNet/OpenAuthAuthenticationTicketHelper.cs | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/DotNetOpenAuth.AspNet/OpenAuthAuthenticationTicketHelper.cs b/src/DotNetOpenAuth.AspNet/OpenAuthAuthenticationTicketHelper.cs index 496e420..abf9a9d 100644 --- a/src/DotNetOpenAuth.AspNet/OpenAuthAuthenticationTicketHelper.cs +++ b/src/DotNetOpenAuth.AspNet/OpenAuthAuthenticationTicketHelper.cs @@ -9,7 +9,6 @@ namespace DotNetOpenAuth.AspNet { using System.Diagnostics; using System.Web; using System.Web.Security; - using DotNetOpenAuth.AspNet.Resources; /// <summary> /// Helper methods for setting and retrieving a custom forms authentication ticket for delegation protocols. @@ -99,12 +98,12 @@ namespace DotNetOpenAuth.AspNet { var ticket = new FormsAuthenticationTicket( /* version */ - 2, - userName, - DateTime.Now, - DateTime.Now.Add(FormsAuthentication.Timeout), - createPersistentCookie, - OpenAuthCookieToken, + 2, + userName, + DateTime.Now, + DateTime.Now.Add(FormsAuthentication.Timeout), + createPersistentCookie, + OpenAuthCookieToken, FormsAuthentication.FormsCookiePath); string encryptedTicket = FormsAuthentication.Encrypt(ticket); @@ -112,10 +111,11 @@ namespace DotNetOpenAuth.AspNet { throw new HttpException(WebResources.FailedToEncryptTicket); } - var cookie = new HttpCookie(FormsAuthentication.FormsCookieName, encryptedTicket) - { - HttpOnly = true, Path = FormsAuthentication.FormsCookiePath, Secure = FormsAuthentication.RequireSSL - }; + var cookie = new HttpCookie(FormsAuthentication.FormsCookieName, encryptedTicket) { + HttpOnly = true, + Path = FormsAuthentication.FormsCookiePath, + Secure = FormsAuthentication.RequireSSL + }; if (FormsAuthentication.CookieDomain != null) { cookie.Domain = FormsAuthentication.CookieDomain; |