Repository navigation
Apply common provider scopes when using issuer-uri - #52795
Open
havefunatcode wants to merge 1 commit into
Open
havefunatcode wants to merge 1 commit into
havefunatcode wants to merge 1 commit into
Conversation
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>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a registration uses a common provider id such as
oktaand the provider is configured with anissuer-uri, the builder comes fromClientRegistrations.fromIssuerLocationand the scopes end up empty. With the provider URIs set by hand instead, the same registration getsopenid,profileandemailfromCommonOAuth2Provider.OKTA.This follows the steps agreed in #25549:
Only the scopes are taken from the common provider. Everything else comes from the issuer metadata, and an explicit
scopeon the registration still wins. A provider id that is not a common one, such asokta-oidc, keeps empty scopes as before.This changes behavior for a common provider id used with
issuer-uriand noscope, including registrations that don't use OIDC login, such asclient_credentials. Those now getopenid,profileandemailtoo, which is what they'd get withoutissuer-uri. I added a sentence about it to the common providers section of the reference docs.See #25549