Skip to content

Commit d9df5eb

Browse files
duanemayCopilot
andauthored
Incorporate Feedback
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent c98c67e commit d9df5eb

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

server/src/main/java/org/cloudfoundry/identity/uaa/provider/oauth/ExternalOAuthAuthenticationManager.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -265,11 +265,11 @@ private IdentityProvider buildInternalUaaIdpConfig(String issuer, String originK
265265
protected AuthenticationData getExternalAuthenticationDetails(final Authentication authentication) {
266266
final ExternalOAuthCodeToken codeToken = (ExternalOAuthCodeToken) authentication;
267267

268-
// A caller that already supplies an origin (the interactive browser SSO callback,
269-
// /login/callback/{origin}) is asserting a specific IdP by URL and must have the presented
270-
// id_token bound to that IdP's own relying party. A caller that omits it (JWT Bearer grant,
271-
// password grant with an id_token) is doing a machine-to-machine token exchange that already
272-
// authenticates the calling client to /oauth/token directly, and deliberately chains tokens
268+
// When the caller supplies an explicit origin (interactive browser callback: /login/callback/{origin}),
269+
// bind the presented id_token to that IdP's relying party (audience).
270+
// When origin is omitted (JWT Bearer/password-grant token exchange), we still validate audience for
271+
// external IdPs, but skip the relying-party audience binding for self-referencing (UAA-issued) tokens
272+
// to allow the intended token-chaining behavior.
273273
// minted for other clients in the same zone/origin - so it is exempt from that binding.
274274
final boolean enforceRelyingPartyAudience = hasLength(codeToken.getOrigin());
275275

0 commit comments

Comments
 (0)