Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Whitespace in provider name in the OAuth2 properties causes mismatch #17487

Closed
wpuhl10775 opened this issue Jul 3, 2019 · 7 comments
Closed
Labels
status: superseded An issue that has been superseded by another type: bug A general bug

Comments

@wpuhl10775
Copy link

Summary

Whitespace in provider name in the OAuth2 properties causes mismatch for provider ID as it is not able to match the ID to the other proprty parameters

Actual Behavior

  1. Define oauth2 properties in application.properties file
spring.security.oauth2.client.registration.xxx.provider=xxx     
spring.security.oauth2.client.provider.xxx.authorization-uri=http://localhost:8282/o/oauth2/v2/auth
  1. Start Spring Boot
  2. Spring Boot throws error: Caused by: java.lang.IllegalStateException: Unknown provider ID 'xxx '

Expected Behavior

Expect 'xxx' provider name to match provider properties

Configuration

spring.security.oauth2.client.registration.fake_oauth.client-id=dummy-client-id
spring.security.oauth2.client.registration.fake_oauth.client-secret=dummy-client-secret
spring.security.oauth2.client.registration.fake_oauth.client-name=fake_oauth
spring.security.oauth2.client.registration.fake_oauth.scope=
spring.security.oauth2.client.registration.fake_oauth.provider=fake_oauth   
spring.security.oauth2.client.registration.fake_oauth.authorization-grant-type=authorization_code
spring.security.oauth2.client.registration.fake_oauth.client-authentication-scheme=basic
spring.security.oauth2.client.registration.fake_oauth.redirect-uri-template=http://localhost:8000/oseries-auth/login/oauth2/code/fake_oauth

spring.security.oauth2.client.provider.fake_oauth.authorization-uri=http://localhost:8282/o/oauth2/v2/auth
spring.security.oauth2.client.provider.fake_oauth.token-uri=http://localhost:8282/oauth2/v4/token
spring.security.oauth2.client.provider.fake_oauth.user-info-uri=http://localhost:8282/oauth2/v3/userinfo
spring.security.oauth2.client.provider.fake_oauth.user-info-authentication-method=basic
spring.security.oauth2.client.provider.fake_oauth.user-name-attribute=name

Version

Spring boot 2.1.2.RELEASE
spring-security-oauth2-client-5.1.3.RELEASE

Sample

@rwinch
Copy link
Member

rwinch commented Jul 3, 2019

Thanks for the report. If we are to do anything for this, I believe it would need to be handled by Spring Boot.

@philwebb What are your thoughts?

@spring-projects-issues

This comment has been minimized.

@philwebb philwebb transferred this issue from spring-projects/spring-security Jul 11, 2019
@philwebb
Copy link
Member

I've transferred the issue

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jul 11, 2019
@philwebb
Copy link
Member

See #4106 for a general discussion on whitespace. The last similar issue to this was #15972 where we trimmed the servlet context path.

@philwebb
Copy link
Member

I'd probably be in favor of trimming the whitespace for this one in OAuth2ClientPropertiesRegistrationAdapter. What are your thoughts @mbhave?

@mbhave
Copy link
Contributor

mbhave commented Jul 11, 2019

Yup I think we can trim it.

@mbhave mbhave added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Jul 11, 2019
@mbhave mbhave added this to the 2.1.x milestone Jul 11, 2019
nosan added a commit to nosan/spring-boot that referenced this issue Jul 12, 2019
nosan added a commit to nosan/spring-boot that referenced this issue Jul 12, 2019
@mbhave
Copy link
Contributor

mbhave commented Jul 12, 2019

Closing in favor of PR #17497.

@mbhave mbhave closed this as completed Jul 12, 2019
@mbhave mbhave added the status: superseded An issue that has been superseded by another label Jul 12, 2019
@snicoll snicoll removed this from the 2.1.x milestone Jul 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: superseded An issue that has been superseded by another type: bug A general bug
Projects
None yet
Development

No branches or pull requests

6 participants