Skip to content

Support space-delimited oauth2 scope #15398

Closed
@jgrandja

Description

@jgrandja

There have been a few reported issues in Spring Security over the last couple of months related to scope being configured using space-delimited instead of comma-delimited.

For example, given this configuration:

spring:
  security:
    oauth2:
      client:
        registration:
          google:
            client-id: your-app-client-id
            client-secret: your-app-client-secret
            scope: openid, profile, email            

This would result in ClientRegistration.scopes.size() == 3.

However, given this configuration:

spring:
  security:
    oauth2:
      client:
        registration:
          google:
            client-id: your-app-client-id
            client-secret: your-app-client-secret
            scope: openid profile email            

This would result in ClientRegistration.scopes.size() == 1, where ClientRegistration.scopes.contains("openid profile email") == true.

For this case, oauth2Login() would not trigger the OpenID Connect flow and instead the standard OAuth 2.0 Authorization Code flow, which is the issue and has been reported as such.

Are we able to enhance the reading/parsing of scope to support space-delimited as well?

Metadata

Metadata

Assignees

No one assigned

    Labels

    for: external-projectFor an external project and not something we can fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions