Exemplo n.º 1
0
        public async Task Invoke(IDictionary <string, object> env)
        {
            var context = new OwinContext(env);

            // Setting Identity => roles go in string[]
            context.Request.User = new GenericPrincipal(new GenericIdentity("someUser"), new string[] { });

            HttpModuleHelper.Print("Middleware", context.Request.User);

            await this._next(env); // call next thing in the pipeline passing envirenment
        }
Exemplo n.º 2
0
 private void context_BeginRequest(object sender, EventArgs e)
 {
     HttpModuleHelper.Print("HttpModule: ", HttpContext.Current.User);
 }
Exemplo n.º 3
0
 public async Task AuthenticateAsync(HttpAuthenticationContext context, CancellationToken cancellationToken)
 {
     HttpModuleHelper.Print("Authentication Filter", context.ActionContext.RequestContext.Principal);
 }
Exemplo n.º 4
0
        protected override bool IsAuthorized(HttpActionContext actionContext)
        {
            HttpModuleHelper.Print("TestAuthorizationFilter", actionContext.RequestContext.Principal);

            return(base.IsAuthorized(actionContext));
        }