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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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);

@franticticktick
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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