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
I have a scenario where I would like to add a new IdP that is not accessible to the internet, but Keycloak is running outside that network and accessible via the internet. In this configuration, my browser can reach both Keycloak and the IdP, but Keycloak itself can not reach the IdP.
The way this would work is that on the callback from the OIDC authorization, the call to the token endpoint would happen via XHR on the website and then passed to the backend to be validated.
My thought is that this should still be possible to do securely as long as:
We are using PKCE
We are validating the JWT signature
The JWT public key is provided manually (since Keycloak can't reach the JWKS endpoint)
This would not be a secure approach as Keycloak should be using a confidential client, and it should control the nonce/state/etc parameters, which shouldn't be delegated to client side. Allowing the client side to control this would make it possible for an attacker to authenticate as a user with Keycloak if they where able to obtain the ID token etc for another user.
@stianst The nonce and state could still be controlled by the server side. The server would still be the one to construct the authorize request. Once the token is obtained, it would be the server's responsibility to validate the issuer, audience, expiration, nonce, and signature of the JWT. I don't know how an attacker would be able to obtain a valid JWT with all of those fields without already having complete control of that user's IDP account.
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 scenario where I would like to add a new IdP that is not accessible to the internet, but Keycloak is running outside that network and accessible via the internet. In this configuration, my browser can reach both Keycloak and the IdP, but Keycloak itself can not reach the IdP.
The way this would work is that on the callback from the OIDC authorization, the call to the token endpoint would happen via XHR on the website and then passed to the backend to be validated.
My thought is that this should still be possible to do securely as long as:
All reactions
Replies: 2 comments
Uh oh!
There was an error while loading. Please reload this page.
This would not be a secure approach as Keycloak should be using a confidential client, and it should control the nonce/state/etc parameters, which shouldn't be delegated to client side. Allowing the client side to control this would make it possible for an attacker to authenticate as a user with Keycloak if they where able to obtain the ID token etc for another user.
All reactions
Uh oh!
There was an error while loading. Please reload this page.
@stianst The nonce and state could still be controlled by the server side. The server would still be the one to construct the
authorizerequest. Once the token is obtained, it would be the server's responsibility to validate the issuer, audience, expiration, nonce, and signature of the JWT. I don't know how an attacker would be able to obtain a valid JWT with all of those fields without already having complete control of that user's IDP account.All reactions