SpringOpaqueTokenIntrospector does not add scopes as granted authorities properly #15165
Labels
in: oauth2
An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose)
type: bug
A general bug
Milestone
Describe the bug
Since the introduction of the
authenticationConverter
in 6.3, the default implementation (this::defaultAuthenticationConverter
) does not add found scopes as granted authorities as part of introspection because the checkif (!(scopes instanceof ArrayListFromString))
always returnsfalse
on line 261, as by the time the scopes list reaches here, it has been converted into a normalArrayList
in theaccessor.getScopes()
as part of thegetClaimAsStringList
default method without customising theClaimConversionService
and therefore fails the check above and returns an empty list.To Reproduce
Use the default implementation of
SpringOpaqueTokenIntrospector
without customisation of it or theClaimConversionService
used by theClaimAccessor
interface.Expected behavior
Scopes are added correctly as "SCOPE_" granted authorities.
Sample
Not sure a sample is required here? This is the default behaviour.
The text was updated successfully, but these errors were encountered: