protected override System.Threading.Tasks.Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, System.Threading.CancellationToken cancellationToken)
        {
            var zumoAuthenticationTokenValidator = new ZumoAuthenticationTokenRequestInspector();

            var identity = zumoAuthenticationTokenValidator.ExtractIdentity(request);
            if (identity != null)
            {
                //TODO: Get roles... inject user repository
                var principal = new GenericPrincipal(identity, new[] {"User"});
                Thread.CurrentPrincipal = principal;
            }
            return base.SendAsync(request, cancellationToken);
        }
Exemplo n.º 2
0
        protected override System.Threading.Tasks.Task <HttpResponseMessage> SendAsync(HttpRequestMessage request, System.Threading.CancellationToken cancellationToken)
        {
            var zumoAuthenticationTokenValidator = new ZumoAuthenticationTokenRequestInspector();

            var identity = zumoAuthenticationTokenValidator.ExtractIdentity(request);

            if (identity != null)
            {
                //TODO: Get roles... inject user repository
                var principal = new GenericPrincipal(identity, new[] { "User" });
                Thread.CurrentPrincipal = principal;
            }
            return(base.SendAsync(request, cancellationToken));
        }