Ejemplo n.º 1
0
        private static void SetAnonymous(HttpContextBase httpContext)
        {
            WebIdentity  identity  = WebIdentity.GetAnonymous();
            WebPrincipal principal = new WebPrincipal(identity);

            httpContext.User = principal;
        }
Ejemplo n.º 2
0
        private static void SetPrincipal(HttpContextBase httpContext, string principalName)
        {
            WebIdentity  identity  = new WebIdentity(principalName);
            WebPrincipal principal = new WebPrincipal(identity);

            httpContext.User = principal;
        }