Skip to content

Apply common provider scopes when using issuer-uri - #52795

Open
havefunatcode wants to merge 1 commit into
spring-projects:mainfrom
havefunatcode:gh-25549-issuer-common-provider-scopes
Open

havefunatcode wants to merge 1 commit into
spring-projects:mainfrom
havefunatcode:gh-25549-issuer-common-provider-scopes

Conversation

@havefunatcode

Copy link
Copy Markdown

When a registration uses a common provider id such as okta and the provider is configured with an issuer-uri, the builder comes from ClientRegistrations.fromIssuerLocation and the scopes end up empty. With the provider URIs set by hand instead, the same registration gets openid, profile and email from CommonOAuth2Provider.OKTA.

This follows the steps agreed in #25549:

  1. Create the builder from the issuer-uri
  2. Add the scopes if it is a common provider
  3. Apply the provider properties
  4. Apply the registration properties

Only the scopes are taken from the common provider. Everything else comes from the issuer metadata, and an explicit scope on the registration still wins. A provider id that is not a common one, such as okta-oidc, keeps empty scopes as before.

This changes behavior for a common provider id used with issuer-uri and no scope, including registrations that don't use OIDC login, such as client_credentials. Those now get openid, profile and email too, which is what they'd get without issuer-uri. I added a sentence about it to the common providers section of the reference docs.

See #25549

When a registration uses a common provider id such as okta together
with an issuer-uri and no scope, the default scopes of the
CommonOAuth2Provider were not applied. Apply them before the
registration properties so that an explicit scope still wins.

See spring-projectsgh-25549

Signed-off-by: Lee Taeho <dlxogh439@gmail.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue that has not yet been triaged. Contributions will not be accepted. label Nov 12, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue that has not yet been triaged. Contributions will not be accepted.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants