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

Trimming the whitespace for the OAuth2 provider property #17497

Closed
wants to merge 1 commit into from

Conversation

nosan
Copy link
Contributor

@nosan nosan commented Jul 12, 2019

see gh-17487

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jul 12, 2019
@nosan nosan changed the title Trimming the whitespace for the provider. Trimming the whitespace for the OAuth2 provider property. Jul 12, 2019
@@ -75,7 +75,8 @@ private static ClientRegistration getClientRegistration(String registrationId,

private static Builder getBuilderFromIssuerIfPossible(String registrationId, String configuredProviderId,
Map<String, Provider> providers) {
String providerId = (configuredProviderId != null) ? configuredProviderId : registrationId;
String providerId = StringUtils
.trimWhitespace((configuredProviderId != null) ? configuredProviderId : registrationId);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this logic can be moved a level up to avoid duplication of the trimming logic?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose it doesn't hurt to trim it but I don't think it's possible to have whitespace at the end of the registrationId since it's a key in the map.

Copy link
Contributor Author

@nosan nosan Jul 12, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's possible to have whitespace at the end of the registrationId since it's a key in the map

I've just realized this and removed my last comment.

@mbhave mbhave added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Jul 12, 2019
@mbhave mbhave added this to the 2.1.x milestone Jul 12, 2019
@philwebb philwebb self-assigned this Jul 24, 2019
philwebb pushed a commit that referenced this pull request Jul 24, 2019
Update `OAuth2ClientPropertiesRegistrationAdapter` to trim whitespace
of the "provider" property.

See gh-17497
@philwebb philwebb closed this in 0da0bff Jul 24, 2019
@nosan nosan deleted the gh-17487 branch July 24, 2019 13:47
@nosan
Copy link
Contributor Author

nosan commented Jul 24, 2019

Thanks, @philwebb

@snicoll snicoll changed the title Trimming the whitespace for the OAuth2 provider property. Trimming the whitespace for the OAuth2 provider property Jul 25, 2019
@snicoll snicoll modified the milestones: 2.1.x, 2.1.7 Jul 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants