Repository navigation
Unable to get tokens for subsequent OAuth Clients when doing first auth through KeyCloak API #35720
Replies: 2 comments 2 replies
|
SSOs work by separating the authentication from the application itself - this is done by having separate sessions for the SSO and the clients. When the user is already authenticated on the SSO, they are no longer required to log in since the SSO can continue using its own session (identified using the cookies stored in the user's browser), even if the clients don't have valid (application) sessions. I assume the REST API circumvents part of the OIDC flows which allows the SSO to create the appropriate cookies in the browser, so the SSO does not have a cookie stored in the browser (or even if it does, the direct grants flow you have described does not use them). |
|
Thanks, @darius-m ... that sounds about right. Can we modify the flow used by the KeyCloak API to enable what's needed... or manually push the auth result from the KeyCloak API to the browsers on the local machine or store what's needed in KeyCloak itself? |
Uh oh!
There was an error while loading. Please reload this page.
We've been pulling out hair out for weeks trying to figure out a way to get Direct Access Grants through Keycloak to then allow public OAuth Clients to automatically get a token without requiring authentication with username/password a second time. This presents as someone signing in first to our main app (web, Mac, Windows) and then being asked a second time for the same username/password when an OAuth client like oCIS Web or Mountain Duck tries to authenticate. We're desperate to find a way to have someone only sign in once since that's the whole point of us using Keycloak in the first place.
We're using the Keycloak API (via the realms//protocol/openid-connect/token endpoint) to directly exchange username/password for a token, bypassing standard OAuth authorization flows. Documentation says "If your apps are directly obtaining tokens via the Keycloak API without redirecting the user through the Authorization Server, other Clients might not be able to share those tokens." but we've been unable to find a way to ensure tokens care be shared. Could this be an issue with lack of PKCE (Proof Key for Code Exchange)?
Hoping someone in the community has come across this before and can suggest a solution!
All reactions