public HttpCookie CreateFormsAuthenticationCookie(OpenIdUser user) { var ticket = new FormsAuthenticationTicket(1, user.ClaimedIdentifier, DateTime.Now, DateTime.Now.AddDays(7), true, user.ToString()); var encrypted = FormsAuthentication.Encrypt(ticket); var cookie = new HttpCookie(FormsAuthentication.FormsCookieName, encrypted); return cookie; }
private OpenIdUser ResponseIntoUser(IAuthenticationResponse response) { OpenIdUser user = null; user = new OpenIdUser(response.ClaimedIdentifier, response.FriendlyIdentifierForDisplay); ; return user; }