Esempio n. 1
0
 /// <summary>
 /// Sets current user info in HttpContext.Current.User
 /// </summary>
 /// <returns></returns>
 public void SetCurrentUserInfo()
 {
     HttpCookie authCookie = HttpContext.Current.Request.Cookies[FormsAuthentication.FormsCookieName];
     if (authCookie != null)
     {
         string encTicket = authCookie.Value;
         if (!String.IsNullOrEmpty(encTicket))
         {
             var ticket = FormsAuthentication.Decrypt(encTicket);
             var id = new OpenIdIdentity(ticket);
             var principal = new OpenIdPrincipal(id);
             HttpContext.Current.User = principal;
         }
     }
 }
Esempio n. 2
0
 public OpenIdPrincipal(OpenIdIdentity id)
 {
     _id = id;
 }