aspnetcore-keycloak icon indicating copy to clipboard operation
aspnetcore-keycloak copied to clipboard

Startup problems?

Open Pulseweaver opened this issue 4 years ago • 0 comments

Hi,

I have problems to get this running, this is what I done :

  • Setup keyclock according to the link. login-callback.html is changed to signin-oidc-callback.html(from the project README.md).
  • appsettings.json is setup like this :

"Oidc": { "Authority": "http://localhost:8080/auth/realms/master", "ClientId": "aspnetcore-keycloak", "ClientSecret": "a057c429-d7d0-4ecb-9f13-8d444587353a" } }

The http://localhost:8080/auth/realms/master is browsable while https://localhost:5001/signin-oidc will throw the following exception :

fail: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware1 An unhandled exception has occurred while executing the request. System.Exception: An error was encountered while handling the remote login. ---> System.Exception: OpenIdConnectAuthenticationHandler: message.State is null or empty. --- End of inner exception stack trace --- at Microsoft.AspNetCore.Authentication.RemoteAuthenticationHandler1.HandleRequestAsync() at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)`

The https://localhost:5001/signin-oidc-callback.html is not reachable and https://localhost:5001/ returns the following :

["http://localhost:8080/auth/realms/master/.well-known/openid-configuration","https://localhost:5001/api/values","https://localhost:5001/signin-oidc","https://localhost:5001/signout-oidc","==== IDENTITY ===============",null,null,"==== TOKENS ===============",null,null,null,"==== HEADERS ===============","HEADER Cache-Control: max-age=0 | HEADER Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9 | HEADER Accept-Encoding: gzip, deflate, br | HEADER Accept-Language: sv,en-US;q=0.9,en;q=0.8 | HEADER Host: localhost:5001 | HEADER User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36 | HEADER Upgrade-Insecure-Requests: 1 | HEADER :method: GET | HEADER :authority: localhost:5001 | HEADER :scheme: https | HEADER :path: / | HEADER sec-fetch-site: none | HEADER sec-fetch-mode: navigate | HEADER sec-fetch-user: ?1 | HEADER sec-fetch-dest: docume

What am I missing?

Pulseweaver avatar Nov 06 '20 09:11 Pulseweaver