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 noticed when doing internal-to-external token exchange against a federated oauth 2 IDP, the expires_in in the response always has a 0 value, even if the token is not expired, and even when the external IDP provides a expires_in value during authentication.
Looking at the implementation of token exchange in oauth 2.0, it looks like the expiration is unconditionally set to 0:
The documentation indicates this is a known possibility, though it doesn't document when:
Expiration information may or may not be included for clients requesting an external issuer through the requested_issuer parameter.
It looks like there has been a lot of work recently around token exchange, and this might easier to solve now. This would create a more consistent experience when using token exchange. Callers of token exchange endpoints wouldn't need to be aware if an IDP is oauth 2 or not.
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 noticed when doing internal-to-external token exchange against a federated oauth 2 IDP, the
expires_inin the response always has a0value, even if the token is not expired, and even when the external IDP provides aexpires_invalue during authentication.Looking at the implementation of token exchange in oauth 2.0, it looks like the expiration is unconditionally set to 0:
keycloak/services/src/main/java/org/keycloak/broker/oidc/AbstractOAuth2IdentityProvider.java
Line 443 in a24183a
Whereas in OIDC, it looks like there is some logic to set this value intelligently
keycloak/services/src/main/java/org/keycloak/broker/oidc/OIDCIdentityProvider.java
Lines 219 to 259 in a24183a
The documentation indicates this is a known possibility, though it doesn't document when:
It looks like there has been a lot of work recently around token exchange, and this might easier to solve now. This would create a more consistent experience when using token exchange. Callers of token exchange endpoints wouldn't need to be aware if an IDP is oauth 2 or not.
Beta Was this translation helpful? Give feedback.
All reactions