protected override bool AuthorizeCore(HttpContextBase httpContext) { var isAuthorized = base.AuthorizeCore(httpContext); if (isAuthorized) { var authenticatedCookie = httpContext.Request.Cookies[FormsAuthentication.FormsCookieName]; if (authenticatedCookie != null) { var authenticatedCookieValue = authenticatedCookie.Value.ToString(); if (!string.IsNullOrWhiteSpace(authenticatedCookieValue)) { var decryptedTicket = FormsAuthentication.Decrypt(authenticatedCookieValue); var user = new OpenIdUser(decryptedTicket.UserData); var openIdIdentity = new OpenIdIdentity(user); httpContext.User = new GenericPrincipal(openIdIdentity, null); } } } return isAuthorized; }
protected override bool AuthorizeCore(HttpContextBase httpContext) { var isAuthorized = base.AuthorizeCore(httpContext); if (isAuthorized) { var authenticatedCookie = httpContext.Request.Cookies[FormsAuthentication.FormsCookieName]; if (authenticatedCookie != null) { var authenticatedCookieValue = authenticatedCookie.Value.ToString(); if (!string.IsNullOrWhiteSpace(authenticatedCookieValue)) { var decryptedTicket = FormsAuthentication.Decrypt(authenticatedCookieValue); var user = new OpenIdUser(decryptedTicket.UserData); var openIdIdentity = new OpenIdIdentity(user); httpContext.User = new GenericPrincipal(openIdIdentity, null); } } } return(isAuthorized); }