Keycloak redirecting to a malformed url

Greetings friends, I’m having a problem with auth success redirect url, when entering on keycloak user login page the address is like:

http://localhost:8080/realms/myrealm/protocol/openid-connect/auth?client_id=my-demo-client&redirect_uri=http%3A%2F%2Flocalhost%3A9000%2F%23%2Fadmin&state=...&response_mode=....&response_type=code&scope=openid&nonce=

And when there’s a successful login the user is redirected to a malformed link:

http://localhost:9000/admin&state=...&response_mode=fragment&response_type=code&scope=openid&nonce=

instead of just ‘…://localhost:9000/admin’

This is breaking vue-router routes, has anyone a problem like this?

IMHO, this may be the effect of using a response_mode=fragment .
Try to remove this parameter. It will be defaulted to “query” for response_type=code .

see Final: OAuth 2.0 Multiple Response Type Encoding Practices

1 Like