Skip to content

Commit 14cedd7

Browse files
author
Steve Riesenberg
committed
Add Client Registration Endpoint in ref doc
Closes gh-672
1 parent 4443312 commit 14cedd7

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

docs/src/docs/asciidoc/protocol-endpoints.adoc

+30-1
Original file line numberDiff line numberDiff line change
@@ -266,4 +266,33 @@ You can customize the ID Token by providing an xref:core-model-components.adoc#o
266266
[[oidc-client-registration-endpoint]]
267267
== OpenID Connect 1.0 Client Registration Endpoint
268268

269-
This section is under construction.
269+
The following example shows how to enable the https://openid.net/specs/openid-connect-registration-1_0.html#ClientRegistration[OpenID Connect 1.0 Client Registration Endpoint]:
270+
271+
[source,java]
272+
----
273+
@Bean
274+
public SecurityFilterChain authorizationServerSecurityFilterChain(HttpSecurity http) throws Exception {
275+
OAuth2AuthorizationServerConfigurer<HttpSecurity> authorizationServerConfigurer =
276+
new OAuth2AuthorizationServerConfigurer<>();
277+
http.apply(authorizationServerConfigurer);
278+
http.oauth2ResourceServer(OAuth2ResourceServerConfigurer::jwt);
279+
280+
authorizationServerConfigurer
281+
.oidc(oidc -> oidc
282+
.clientRegistrationEndpoint(Customizer.withDefaults())
283+
);
284+
285+
return http.build();
286+
}
287+
288+
@Bean
289+
public JwtDecoder jwtDecoder(JWKSource<SecurityContext> jwkSource) {
290+
return OAuth2AuthorizationServerConfiguration.jwtDecoder(jwkSource);
291+
}
292+
----
293+
294+
[NOTE]
295+
A `JwtDecoder` is *REQUIRED* for the OpenID Connect 1.0 Client Registration Endpoint. See xref:configuration-model.adoc#default-configuration[Default configuration] for more information.
296+
297+
`OidcClientRegistrationEndpointConfigurer` configures the `OidcClientRegistrationEndpointFilter` and registers it with the OAuth2 authorization server `SecurityFilterChain` `@Bean`.
298+
`OidcClientRegistrationEndpointFilter` is the `Filter` that processes https://openid.net/specs/openid-connect-registration-1_0.html#RegistrationRequest[Client Registration requests] and returns the https://openid.net/specs/openid-connect-registration-1_0.html#RegistrationResponse[`OidcClientRegistration`].

0 commit comments

Comments
 (0)