summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.AspNet/OpenAuthAuthenticationTicketHelper.cs
diff options
context:
space:
mode:
authorMicrosoft <aspnet@microsoft.com>2012-05-03 18:03:57 -0700
committerMicrosoft <aspnet@microsoft.com>2012-05-03 18:03:57 -0700
commit36e1af61367dd27ddde47652b9ca0619018ae87b (patch)
treee84985ab7b72e12ab483e273f0f64db47d8639c4 /src/DotNetOpenAuth.AspNet/OpenAuthAuthenticationTicketHelper.cs
parent8e6ea95502ca34ef9ab9e071742a6d2e16c868ca (diff)
downloadDotNetOpenAuth-36e1af61367dd27ddde47652b9ca0619018ae87b.zip
DotNetOpenAuth-36e1af61367dd27ddde47652b9ca0619018ae87b.tar.gz
DotNetOpenAuth-36e1af61367dd27ddde47652b9ca0619018ae87b.tar.bz2
Use cookie to store OAuth token and set it as default mechanism. Fix an issue in Facebook account with encoded return url. Update Twitter urls. Catch exception in VerifyAuthentication and return as Failed.
Diffstat (limited to 'src/DotNetOpenAuth.AspNet/OpenAuthAuthenticationTicketHelper.cs')
-rw-r--r--src/DotNetOpenAuth.AspNet/OpenAuthAuthenticationTicketHelper.cs12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/DotNetOpenAuth.AspNet/OpenAuthAuthenticationTicketHelper.cs b/src/DotNetOpenAuth.AspNet/OpenAuthAuthenticationTicketHelper.cs
index 3fc3a21..f51de1c 100644
--- a/src/DotNetOpenAuth.AspNet/OpenAuthAuthenticationTicketHelper.cs
+++ b/src/DotNetOpenAuth.AspNet/OpenAuthAuthenticationTicketHelper.cs
@@ -106,10 +106,16 @@ namespace DotNetOpenAuth.AspNet {
var cookie = new HttpCookie(FormsAuthentication.FormsCookieName, encryptedTicket) {
HttpOnly = true,
- Path = FormsAuthentication.FormsCookiePath,
- Secure = FormsAuthentication.RequireSSL
+ Path = FormsAuthentication.FormsCookiePath
};
+ // only set Secure if FormsAuthentication requires SSL.
+ // otherwise, leave it to default value
+ if (FormsAuthentication.RequireSSL)
+ {
+ cookie.Secure = true;
+ }
+
if (FormsAuthentication.CookieDomain != null) {
cookie.Domain = FormsAuthentication.CookieDomain;
}
@@ -123,4 +129,4 @@ namespace DotNetOpenAuth.AspNet {
#endregion
}
-}
+} \ No newline at end of file