Reputation: 155
I'm trying to run keycloak as the simplest OpenID server with the simplest app to authenticate users.
My steps:
docker run -p 8080:8080 -e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=admin jboss/keycloak
swarm
, I set Authorization Enabled
to true, I set Valid Redirect URIs to http://myapp/test.php
, rest is default.http://myapp/test.php
I have just link to http://localhost:8080/auth/realms/master/protocol/openid-connect/auth?client_id=swarm&response_type=code&scope=code&redirect_url=http://myapp/test.php
which I clickhttp://myapp/test.php?session_state=c15d4d10-31a9-41d8-a8ba-9ea84d8fd4fa&code=ey...FA
(I cut code, as it was long)curl
manually, by calling curl -d "client_id=swarm" -d "grant_type=authorization_code" -d "client_secret=51d9de29-35f8-4692-bdfc-72f4c0a5b25f" -d "session_state=62f12f56-968b-4068-bbb5-95e5c9f1bc23" -d "code=eey...FA" http://localhost:8080/auth/realms/master/protocol/openid-connect/token
In Keycloak logs I'm getting NullPointerException
when trying to get a token from openid with this logs:
10:02:16,987 ERROR [org.keycloak.services.error.KeycloakErrorHandler] (default task-14) Uncaught server error: java.lang.NullPointerException at > org.keycloak.protocol.oidc.endpoints.TokenEndpoint.codeToToken(TokenEndpoint.java:310) at > org.keycloak.protocol.oidc.endpoints.TokenEndpoint.processGrantRequest(TokenEndpoint.java:172) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Not sure what I can do next. I'll be helpful for any help.
Upvotes: 1
Views: 2261
Reputation: 46
Provide a request_uri
in your request #5. Use the same as in the first request.
Upvotes: 3