private static void SetAnonymous(HttpContextBase httpContext) { WebIdentity identity = WebIdentity.GetAnonymous(); WebPrincipal principal = new WebPrincipal(identity); httpContext.User = principal; }
private static void SetPrincipal(HttpContextBase httpContext, string principalName) { WebIdentity identity = new WebIdentity(principalName); WebPrincipal principal = new WebPrincipal(identity); httpContext.User = principal; }