Ejemplo n.º 1
0
        public async Task <bool> IsTokenValid(SomeValidationContext context, string token)
        {
            await Task.Run(() => { });

            var handler = new JwtSecurityTokenHandler();

            var jsonToken = handler.ReadToken(token);

            var jwtSecurityTokens = handler.ReadToken(token) as JwtSecurityToken;

            // here you can check if the token received is valid
            return(true);
        }
        public BearerAuthorizationHandler(IHttpContextAccessor httpContextAccessor, SomeValidationContext thatYouCanInject)
        {
            _thatYouCanInject = thatYouCanInject;

            _httpContextAccessor = httpContextAccessor;
        }