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
fix(oauth): auto-learn IdP audience and persist as resource for token validation (#4404)
* fix(oauth): auto-learn IdP audience and persist as resource for token validation
OAuth token audience validation fails for IdPs (ServiceNow, Authentik,
etc.) that do not honor RFC 8707 and set the aud claim to an abstract
identifier (e.g. client_id) rather than the resource URL sent in the
authorization request. RFC 8707 Section 2 explicitly allows this: the
AS may map the resource value to a different audience identifier.
After a successful OAuth callback, extract the aud claim from the access
token (best-effort, no signature verification) inside oauth_manager and
return it as token_aud. Persist it as resource in the gateway's
oauth_config. On subsequent flows, use the persisted resource as-is
instead of re-deriving from gateway.url. Update _validate_audience to
accept both resource (string or list) and gateway_url via set
intersection.
Closes#4384
Related: #4171
Signed-off-by: Madhav Kandukuri <madhav165@gmail.com>
* update .secrets.baseline
Signed-off-by: Madhav Kandukuri <madhav165@gmail.com>
* fix(oauth): correct doctest quote style for blocking_errors example
Signed-off-by: Madhav Kandukuri <madhav165@gmail.com>
* Update secrets
Signed-off-by: Brian Hussey <brian.hussey@ie.ibm.com>
---------
Signed-off-by: Madhav Kandukuri <madhav165@gmail.com>
Signed-off-by: Brian Hussey <brian.hussey@ie.ibm.com>
Co-authored-by: Brian Hussey <brian.hussey@ie.ibm.com>
logger.info(f"Completed OAuth flow for gateway {SecurityValidator.sanitize_log_message(gateway_id)}, user {SecurityValidator.sanitize_log_message(str(result.get('user_id')))}")
569
587
570
588
# Return success page with option to return to admin
0 commit comments