IdentityServer / IdentityServer4.AccessTokenValidation

IdentityServer Access Token Validation for ASP.NET Core
Apache License 2.0
544 stars 214 forks source link

Authorization failed for user: (null) #58

Closed eisenreich closed 7 years ago

eisenreich commented 7 years ago

I cloned the samples repository and set up the Quickstarts/6_AspNetIdentity solution. The first time everything worked well and I exchanged the EFCore framework with a MongoDb provider. Still everything works. After I deleted the whole repository and setup a new, cleaner version within the MongoDb provider, I got the problem that at the Consent page I dont get redirect to the MvcClient.

Most time I run the projects with "Shift + F5" and test it in usual Google Chrome. I found out, that if I run the same MvcClient project with F5 with the Debug Google Chrome it works. Also with Internet Explorer or MS Edge and MvcClient in combination with "Shift + F5".

So any old data from the usual Google Chrome disturbs the authentication/authorization process. On the IdentityServer each authentication request suceed.

The output of the MvcClient console:

info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] Request starting HTTP/1.1 GET http://localhost:5002/Home/Secure info: Microsoft.AspNetCore.Authorization.DefaultAuthorizationService[2] Authorization failed for user: (null). info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] Authorization failed for the request at filter 'Microsoft.AspNetCore.Mvc.Authorization.AuthorizeFilter'. info: Microsoft.AspNetCore.Mvc.ChallengeResult[1] Executing ChallengeResult with authentication schemes (). info: Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectMiddleware[12] AuthenticationScheme: oidc was challenged. info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] Executed action MvcClient.Controllers.HomeController.Secure (MvcClient) in 1.6528ms info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] Request finished in 3.2216ms 302

eisenreich commented 7 years ago

Wrong Repository, sorry!