I have a external openidconnect
identity provider registered with Keycloak
. When the client app tries to access the protected resource it gets redirected to KeyCloak
login page. On the login page I have the external openidconnect
provider buttons enabled. Once the user clicks on the button he is taken to the external identity provider (which is identityserver3 instance). The external provider does authenticate the user and send back a code.
Now the redirecturl for the registered client in the external identity provider is that of keycloak's. So after authentication is successful at the external IDP it send back the code(because it is Auth code flow) to keycloak at a redirect url:
In the URL if you see it ends with endpoint
. I don't think that's correct but I cannot change it in KeyCloak (it's disabled) and because of that in the external IDP client configuration.
KeyCloak does not understand above url and errors out with a message "unexpected error when authenticating with Identity Provider"
Isn't KeyCloak
supposed to understand the code flow and make another request for token after receiving the code. Then the external IDP will respond with token and Keycloak
will send back that token to client(will also store it for future use).
Can someone please share some knowledge on how Keycloak
works with external openidconnect ID provider with code flow.