-
Background:I have multiple Identity Providers (IDP) enabled in my realm. But one of my application is design to only use one of the IDP. Do I need a separate realm for that? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Solution:No, do not request for a separate realm in this case. Here are two ways to achieve it. Option 1:Use IDP hint to get your app to pre-select the idp. To do so, include However, if your application does not support this customization. Try Option 2. Option 2:Override
Additional NotesTo add to this - The IDP Hint only helps with bypassing the "choose your IDP" screen, and does NOT enforce any particular role/group/authorization for a client/service. Since your realm has multiple IDPs, you may be faced with a situation where a user is already logged into your realm and does not follow the login flow (or the Hint). Some possible flows when using a single realm for more than 1 application: possible error flow:
Alternative possible error flow (with Application B using a separate Authentication Flow):
Some things to think about when multiple clients are leveraging the same realm.
More ideas? options? separation of auth/auth tricks and tips (ie: separation of Authentication and Authorization) Reference: bcgov/ocp-sso#69 |
Beta Was this translation helpful? Give feedback.
Solution:
No, do not request for a separate realm in this case. Here are two ways to achieve it.
Option 1:
Use IDP hint to get your app to pre-select the idp. To do so, include
kc_idp_hint=xxx
in the auth url. For example: https://{KC_URL}/realms/{REALM}/protocol/openid-connect/auth?...&kc_idp_hint=githubHowever, if your application does not support this customization. Try Option 2.
Option 2:
Override
Authentication Flow
for the app's keycloak client.Browser Flow
withIdentity Provider Redirector
enabled and configured with the target IDP.Authentication Flow Overrides
and select the new auth flow.Additional Notes
To add to this…