Skip to content

Propagate externalGroupsWhitelist for bootstrapped OAuth/OIDC identity providers - #4005

Merged
duanemay merged 1 commit into
developfrom
worktree-tnz-122495-oauth-external-groups-whitelist
Jul 28, 2026
Merged

Propagate externalGroupsWhitelist for bootstrapped OAuth/OIDC identity providers#4005
duanemay merged 1 commit into
developfrom
worktree-tnz-122495-oauth-external-groups-whitelist

Conversation

@duanemay

Copy link
Copy Markdown
Member

Summary

  • OauthIDPWrapperFactoryBean bootstraps OAuth/OIDC identity providers from YAML config, but never read externalGroupsWhitelist from that config map — every bootstrapped OAuth/OIDC IdP silently got an empty whitelist regardless of what was configured, so external group claims were never included in the resulting token.
  • LDAP (LdapUtils) and SAML (BootstrapSamlIdentityProviderData) bootstrap paths already wire this property through from their respective config maps; only the OAuth/OIDC path was missing it.
  • Fix: read externalGroupsWhitelist from the IdP definition map in setCommonProperties and apply it via setExternalGroupsWhitelist, matching the existing LDAP/SAML behavior.

Test plan

  • Added external_groups_whitelist_default_is_empty — confirms unset config still defaults to an empty whitelist.
  • Added external_groups_whitelist_in_body — confirms a configured whitelist (e.g. ["*"]) now flows through to the provider definition.
  • Ran OauthIdentityProviderDefinitionFactoryBeanTest locally — all 28 tests pass.

OauthIDPWrapperFactoryBean never read externalGroupsWhitelist from the
YAML-configured IdP definition map, so any OAuth/OIDC identity provider
bootstrapped via config always ended up with an empty whitelist,
silently dropping external group claims regardless of what was
configured. LDAP and SAML bootstrap paths already wire this property
through; OAuth/OIDC was missing it.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes bootstrapping of OAuth/OIDC identity providers from YAML so that externalGroupsWhitelist is propagated into the provider definition (matching existing LDAP/SAML bootstrap behavior). This restores expected inclusion/filtering of external group claims when configured.

Changes:

  • Read externalGroupsWhitelist from the OAuth/OIDC IdP definition map and apply it to the provider definition during bootstrap.
  • Add unit tests verifying default behavior (empty whitelist) and configured behavior (e.g., ["*"]).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
server/src/main/java/org/cloudfoundry/identity/uaa/provider/oauth/OauthIDPWrapperFactoryBean.java Propagates externalGroupsWhitelist from the YAML config map into the OAuth/OIDC IdP definition.
server/src/test/java/org/cloudfoundry/identity/uaa/provider/oauth/OauthIdentityProviderDefinitionFactoryBeanTest.java Adds coverage ensuring the whitelist defaults to empty and is correctly mapped when configured.

@github-project-automation github-project-automation Bot moved this from Inbox to Pending Merge | Prioritized in Foundational Infrastructure Working Group Jul 28, 2026
@duanemay
duanemay merged commit 47d5513 into develop Jul 28, 2026
27 checks passed
@duanemay
duanemay deleted the worktree-tnz-122495-oauth-external-groups-whitelist branch July 28, 2026 15:40
@github-project-automation github-project-automation Bot moved this from Pending Merge | Prioritized to Done in Foundational Infrastructure Working Group Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

3 participants