ch4mpy / spring-addons

Ease spring OAuth2 resource-servers configuration and testing
Apache License 2.0
530 stars 87 forks source link

Claims used as authorities source should be split on space and comma (and trimmed) #125

Closed ch4mpy closed 1 year ago

ch4mpy commented 1 year ago

Describe the bug When scope claim (or scp) is used as source for authorities, space separated values are interpreted as a single value. It should not.

Code sample

com:
  c4-soft:
    springaddons:
      security:
        issuers:
        - location: ${oauth2-issuer}
          username-claim: $['https://c4-soft.com/user']['name']
          authorities:
          - path: $.scope
            prefix: SCOPE_

Expected behavior Each scope entry in the scope claim should be mapped to an individual GrantedAuthority (each prefixed with SCOPE_ in the sample above)