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

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

            httpContext.User = principal;
        }