Block a federated (brokered) user from a specific OIDC client based on an IdP role, at login — out-of-box? · keycloak keycloak · Discussion #49519 · GitHub
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
8000
Repository navigation
Block a federated (brokered) user from a specific OIDC client based on an IdP role, at login — out-of-box?
#49519
I have a Keycloak realm acting as an identity broker for upstream ADFS. Apps are confidential OIDC clients
of the broker realm. Upstream supplies a group/role claim, which an IdP claim-to-role mapper turns into a Keycloak client role — that part works end-to-end.
What I want: at login, deny a federated user access to a specific client if they lack that client's required role, while still letting them into the clients they are entitled to.
The standard browser-flow role gate appears to be bypassed for brokered logins, and the only post-brokering hook (the Post Broker Login flow) is per-IdP, not per-client, with no stock "condition on client" authenticator. The same role gate does work for direct local logins, but my deployment is federated-only.
Is there an out-of-box way to enforce this per-client, at login, for brokered users — without a custom SPI/authenticator? If not, what's the recommended approach (Post Broker Login conditions, client policies, authorization services, etc.)?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
I have a Keycloak realm acting as an identity broker for upstream ADFS. Apps are confidential OIDC clients
of the broker realm. Upstream supplies a group/role claim, which an IdP claim-to-role mapper turns into a Keycloak client role — that part works end-to-end.
What I want: at login, deny a federated user access to a specific client if they lack that client's required role, while still letting them into the clients they are entitled to.
The standard browser-flow role gate appears to be bypassed for brokered logins, and the only post-brokering hook (the Post Broker Login flow) is per-IdP, not per-client, with no stock "condition on client" authenticator. The same role gate does work for direct local logins, but my deployment is federated-only.
Is there an out-of-box way to enforce this per-client, at login, for brokered users — without a custom SPI/authenticator? If not, what's the recommended approach (Post Broker Login conditions, client policies, authorization services, etc.)?
All reactions