Skip to content

Consider configuring OAuth2AuthorizationRequestResolver by publishing a bean #15236

Closed
@sjohnr

Description

@sjohnr

We should consider adding support for configuring OAuth2AuthorizationRequestResolver by publishing a bean. This would simplify this customization and allow for the following configuration:

@Bean
public OAuth2AuthorizationRequestResolver authorizationRequestResolver(
		ClientRegistrationRepository clientRegistrationRepository) {

	var authorizationRequestResolver =
		new DefaultOAuth2AuthorizationRequestResolver(
			clientRegistrationRepository,
			OAuth2AuthorizationRequestRedirectFilter.DEFAULT_AUTHORIZATION_REQUEST_BASE_URI);
	authorizationRequestResolver.setAuthorizationRequestCustomizer(
		OAuth2AuthorizationRequestCustomizers.withPkce());

	return authorizationRequestResolver;
}

The same would apply with the reactive stack and ServerOAuth2AuthorizationRequestResolver. See this comment for additional context. cc @randomstuff

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: oauth2An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose)status: ideal-for-contributionAn issue that we actively are looking for someone to help us withtype: enhancementA general enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions