-
Notifications
You must be signed in to change notification settings - Fork 1.3k
How-to: Customize client metadata during dynamic client registration #1044
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
Comments
The extension point for customizing client metadata before it's saved to Here is a sample configuration: @Bean
public SecurityFilterChain authorizationServerSecurityFilterChain(HttpSecurity http) throws Exception {
OAuth2AuthorizationServerConfigurer authorizationServerConfigurer =
new OAuth2AuthorizationServerConfigurer();
authorizationServerConfigurer
.oidc(oidc ->
oidc
.clientRegistrationEndpoint(clientRegistration ->
clientRegistration
.authenticationProviders(configureRegisteredClientConverter())
)
);
...
}
private Consumer<List<AuthenticationProvider>> configureRegisteredClientConverter() {
return (authenticationProviders) ->
authenticationProviders.forEach(authenticationProvider -> {
if (authenticationProvider instanceof OidcClientRegistrationAuthenticationProvider) {
OidcClientRegistrationAuthenticationProvider clientRegistrationAuthenticationProvider =
(OidcClientRegistrationAuthenticationProvider) authenticationProvider;
clientRegistrationAuthenticationProvider.setRegisteredClientConverter(
new CustomRegisteredClientConverter());
}
});
}
private static final class CustomRegisteredClientConverter implements Converter<OidcClientRegistration, RegisteredClient> {
@Override
public RegisteredClient convert(OidcClientRegistration clientRegistration) {
// TODO Implement conversion from OidcClientRegistration to RegisteredClient
// See default implementation OidcClientRegistrationAuthenticationProvider.OidcClientRegistrationRegisteredClientConverter
}
} |
@jgrandja can I be assigned this issue? Should the contents of this how-to be appended to the existing "Register a client dynamically" guide? or should it be a follow-up standalone how-to guide? |
Yes. Please add it to the existing guide. |
We should provide a guide that demonstrates how to customize the client metadata in
OidcClientRegistration
when it's provided to the OpenID Connect 1.0 Dynamic Client Registration EndpointOidcClientRegistrationAuthenticationProvider
.Related gh-647
The text was updated successfully, but these errors were encountered: