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

Add Support OAuth2AuthorizationRequestResolver As Bean #16381

Merged
merged 1 commit into from
Jan 10, 2025

Conversation

franticticktick
Copy link
Contributor

Closes gh-16380

Copy link
Contributor

@kse-music kse-music left a comment

Choose a reason for hiding this comment

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

Is it better to return early when the OAuth2AuthorizationRequestResolver bean exists?

OAuth2AuthorizationRequestResolver bean = getBeanOrNull(resolvableType);
if(bean != null) {
    return bean;
}
String authorizationRequestBaseUri = this.authorizationEndpointConfig.authorizationRequestBaseUri;
if (authorizationRequestBaseUri == null) {
	authorizationRequestBaseUri = OAuth2AuthorizationRequestRedirectFilter.DEFAULT_AUTHORIZATION_REQUEST_BASE_URI;
}
return new DefaultOAuth2AuthorizationRequestResolver(clientRegistrationRepository,
		authorizationRequestBaseUri);

Closes spring-projectsgh-16380

Signed-off-by: Max Batischev <mblancer@mail.ru>
@franticticktick
Copy link
Contributor Author

Hey @kse-music , thanks for suggestion, this will be a good polish.

@rwinch rwinch self-assigned this Jan 10, 2025
@rwinch rwinch added in: config An issue in spring-security-config type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Jan 10, 2025
@rwinch rwinch added this to the 6.5.0-M1 milestone Jan 10, 2025
@rwinch rwinch merged commit bf9b95a into spring-projects:main Jan 10, 2025
6 checks passed
@rwinch
Copy link
Member

rwinch commented Jan 10, 2025

Thanks for the Pull Request! This is now merged into main 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: config An issue in spring-security-config type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Configuring OAuth2 Login with OAuth2AuthorizationRequestResolver by publishing a Bean
4 participants