Skip to content

Commit 128d439

Browse files
committed
Polish gh-1158
1 parent 213048b commit 128d439

File tree

3 files changed

+28
-18
lines changed

3 files changed

+28
-18
lines changed

docs/src/docs/asciidoc/configuration-model.adoc

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
The OAuth2 authorization server `SecurityFilterChain` `@Bean` is configured with the following default protocol endpoints:
1515

1616
* xref:protocol-endpoints.adoc#oauth2-authorization-endpoint[OAuth2 Authorization endpoint]
17+
* xref:protocol-endpoints.adoc#oauth2-device-authorization-endpoint[OAuth2 Device Authorization Endpoint]
18+
* xref:protocol-endpoints.adoc#oauth2-device-verification-endpoint[OAuth2 Device Verification Endpoint]
1719
* xref:protocol-endpoints.adoc#oauth2-token-endpoint[OAuth2 Token endpoint]
1820
* xref:protocol-endpoints.adoc#oauth2-token-introspection-endpoint[OAuth2 Token Introspection endpoint]
1921
* xref:protocol-endpoints.adoc#oauth2-token-revocation-endpoint[OAuth2 Token Revocation endpoint]
@@ -93,7 +95,7 @@ The main intent of `OAuth2AuthorizationServerConfiguration` is to provide a conv
9395

9496
`OAuth2AuthorizationServerConfigurer` provides the ability to fully customize the security configuration for an OAuth2 authorization server.
9597
It lets you specify the core components to use - for example, xref:core-model-components.adoc#registered-client-repository[`RegisteredClientRepository`], xref:core-model-components.adoc#oauth2-authorization-service[`OAuth2AuthorizationService`], xref:core-model-components.adoc#oauth2-token-generator[`OAuth2TokenGenerator`], and others.
96-
Furthermore, it lets you customize the request processing logic for the protocol endpoints – for example, xref:protocol-endpoints.adoc#oauth2-authorization-endpoint[authorization endpoint], xref:protocol-endpoints.adoc#oauth2-token-endpoint[token endpoint], xref:protocol-endpoints.adoc#oauth2-token-introspection-endpoint[token introspection endpoint], and others.
98+
Furthermore, it lets you customize the request processing logic for the protocol endpoints – for example, xref:protocol-endpoints.adoc#oauth2-authorization-endpoint[authorization endpoint], xref:protocol-endpoints.adoc#oauth2-device-authorization-endpoint[device authorization endpoint], xref:protocol-endpoints.adoc#oauth2-device-verification-endpoint[device verification endpoint], xref:protocol-endpoints.adoc#oauth2-token-endpoint[token endpoint], xref:protocol-endpoints.adoc#oauth2-token-introspection-endpoint[token introspection endpoint], and others.
9799

98100
`OAuth2AuthorizationServerConfigurer` provides the following configuration options:
99101

@@ -113,14 +115,16 @@ public SecurityFilterChain authorizationServerSecurityFilterChain(HttpSecurity h
113115
.tokenGenerator(tokenGenerator) <5>
114116
.clientAuthentication(clientAuthentication -> { }) <6>
115117
.authorizationEndpoint(authorizationEndpoint -> { }) <7>
116-
.tokenEndpoint(tokenEndpoint -> { }) <8>
117-
.tokenIntrospectionEndpoint(tokenIntrospectionEndpoint -> { }) <9>
118-
.tokenRevocationEndpoint(tokenRevocationEndpoint -> { }) <10>
119-
.authorizationServerMetadataEndpoint(authorizationServerMetadataEndpoint -> { }) <11>
118+
.deviceAuthorizationEndpoint(deviceAuthorizationEndpoint -> { }) <8>
119+
.deviceVerificationEndpoint(deviceVerificationEndpoint -> { }) <9>
120+
.tokenEndpoint(tokenEndpoint -> { }) <10>
121+
.tokenIntrospectionEndpoint(tokenIntrospectionEndpoint -> { }) <11>
122+
.tokenRevocationEndpoint(tokenRevocationEndpoint -> { }) <12>
123+
.authorizationServerMetadataEndpoint(authorizationServerMetadataEndpoint -> { }) <13>
120124
.oidc(oidc -> oidc
121-
.providerConfigurationEndpoint(providerConfigurationEndpoint -> { }) <12>
122-
.userInfoEndpoint(userInfoEndpoint -> { }) <13>
123-
.clientRegistrationEndpoint(clientRegistrationEndpoint -> { }) <14>
125+
.providerConfigurationEndpoint(providerConfigurationEndpoint -> { }) <14>
126+
.userInfoEndpoint(userInfoEndpoint -> { }) <15>
127+
.clientRegistrationEndpoint(clientRegistrationEndpoint -> { }) <16>
124128
);
125129
126130
return http.build();
@@ -133,13 +137,15 @@ public SecurityFilterChain authorizationServerSecurityFilterChain(HttpSecurity h
133137
<5> `tokenGenerator()`: The xref:core-model-components.adoc#oauth2-token-generator[`OAuth2TokenGenerator`] for generating tokens supported by the OAuth2 authorization server.
134138
<6> `clientAuthentication()`: The configurer for <<configuring-client-authentication, OAuth2 Client Authentication>>.
135139
<7> `authorizationEndpoint()`: The configurer for the xref:protocol-endpoints.adoc#oauth2-authorization-endpoint[OAuth2 Authorization endpoint].
136-
<8> `tokenEndpoint()`: The configurer for the xref:protocol-endpoints.adoc#oauth2-token-endpoint[OAuth2 Token endpoint].
137-
<9> `tokenIntrospectionEndpoint()`: The configurer for the xref:protocol-endpoints.adoc#oauth2-token-introspection-endpoint[OAuth2 Token Introspection endpoint].
138-
<10> `tokenRevocationEndpoint()`: The configurer for the xref:protocol-endpoints.adoc#oauth2-token-revocation-endpoint[OAuth2 Token Revocation endpoint].
139-
<11> `authorizationServerMetadataEndpoint()`: The configurer for the xref:protocol-endpoints.adoc#oauth2-authorization-server-metadata-endpoint[OAuth2 Authorization Server Metadata endpoint].
140-
<12> `providerConfigurationEndpoint()`: The configurer for the xref:protocol-endpoints.adoc#oidc-provider-configuration-endpoint[OpenID Connect 1.0 Provider Configuration endpoint].
141-
<13> `userInfoEndpoint()`: The configurer for the xref:protocol-endpoints.adoc#oidc-user-info-endpoint[OpenID Connect 1.0 UserInfo endpoint].
142-
<14> `clientRegistrationEndpoint()`: The configurer for the xref:protocol-endpoints.adoc#oidc-client-registration-endpoint[OpenID Connect 1.0 Client Registration endpoint].
140+
<8> `deviceAuthorizationEndpoint()`: The configurer for the xref:protocol-endpoints.adoc#oauth2-device-authorization-endpoint[OAuth2 Device Authorization endpoint].
141+
<9> `deviceVerificationEndpoint()`: The configurer for the xref:protocol-endpoints.adoc#oauth2-device-verification-endpoint[OAuth2 Device Verification endpoint].
142+
<10> `tokenEndpoint()`: The configurer for the xref:protocol-endpoints.adoc#oauth2-token-endpoint[OAuth2 Token endpoint].
143+
<11> `tokenIntrospectionEndpoint()`: The configurer for the xref:protocol-endpoints.adoc#oauth2-token-introspection-endpoint[OAuth2 Token Introspection endpoint].
144+
<12> `tokenRevocationEndpoint()`: The configurer for the xref:protocol-endpoints.adoc#oauth2-token-revocation-endpoint[OAuth2 Token Revocation endpoint].
145+
<13> `authorizationServerMetadataEndpoint()`: The configurer for the xref:protocol-endpoints.adoc#oauth2-authorization-server-metadata-endpoint[OAuth2 Authorization Server Metadata endpoint].
146+
<14> `providerConfigurationEndpoint()`: The configurer for the xref:protocol-endpoints.adoc#oidc-provider-configuration-endpoint[OpenID Connect 1.0 Provider Configuration endpoint].
147+
<15> `userInfoEndpoint()`: The configurer for the xref:protocol-endpoints.adoc#oidc-user-info-endpoint[OpenID Connect 1.0 UserInfo endpoint].
148+
<16> `clientRegistrationEndpoint()`: The configurer for the xref:protocol-endpoints.adoc#oidc-client-registration-endpoint[OpenID Connect 1.0 Client Registration endpoint].
143149

144150
[[configuring-authorization-server-settings]]
145151
== Configuring Authorization Server Settings
@@ -157,6 +163,8 @@ public final class AuthorizationServerSettings extends AbstractSettings {
157163
public static Builder builder() {
158164
return new Builder()
159165
.authorizationEndpoint("/oauth2/authorize")
166+
.deviceAuthorizationEndpoint("/oauth2/device_authorization")
167+
.deviceVerificationEndpoint("/oauth2/device_verification")
160168
.tokenEndpoint("/oauth2/token")
161169
.tokenIntrospectionEndpoint("/oauth2/introspect")
162170
.tokenRevocationEndpoint("/oauth2/revoke")
@@ -185,6 +193,8 @@ public AuthorizationServerSettings authorizationServerSettings() {
185193
return AuthorizationServerSettings.builder()
186194
.issuer("https://example.com")
187195
.authorizationEndpoint("/oauth2/v1/authorize")
196+
.deviceAuthorizationEndpoint("/oauth2/v1/device_authorization")
197+
.deviceVerificationEndpoint("/oauth2/v1/device_verification")
188198
.tokenEndpoint("/oauth2/v1/token")
189199
.tokenIntrospectionEndpoint("/oauth2/v1/introspect")
190200
.tokenRevocationEndpoint("/oauth2/v1/revoke")

docs/src/docs/asciidoc/core-model-components.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public class RegisteredClient implements Serializable {
8484
<5> `clientSecretExpiresAt`: The time at which the client secret expires.
8585
<6> `clientName`: A descriptive name used for the client. The name may be used in certain scenarios, such as when displaying the client name in the consent page.
8686
<7> `clientAuthenticationMethods`: The authentication method(s) that the client may use. The supported values are `client_secret_basic`, `client_secret_post`, https://datatracker.ietf.org/doc/html/rfc7523[`private_key_jwt`], `client_secret_jwt`, and `none` https://datatracker.ietf.org/doc/html/rfc7636[(public clients)].
87-
<8> `authorizationGrantTypes`: The https://datatracker.ietf.org/doc/html/rfc6749#section-1.3[authorization grant type(s)] that the client can use. The supported values are `authorization_code`, `client_credentials`, and `refresh_token`.
87+
<8> `authorizationGrantTypes`: The https://datatracker.ietf.org/doc/html/rfc6749#section-1.3[authorization grant type(s)] that the client can use. The supported values are `authorization_code`, `client_credentials`, `refresh_token`, and `urn:ietf:params:oauth:grant-type:device_code`.
8888
<9> `redirectUris`: The registered https://datatracker.ietf.org/doc/html/rfc6749#section-3.1.2[redirect URI(s)] that the client may use in redirect-based flows – for example, `authorization_code` grant.
8989
<10> `scopes`: The scope(s) that the client is allowed to request.
9090
<11> `clientSettings`: The custom settings for the client – for example, require https://datatracker.ietf.org/doc/html/rfc7636[PKCE], require authorization consent, and others.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ static class CustomRedirectUriValidator implements Consumer<OAuth2AuthorizationC
123123
[[oauth2-device-authorization-endpoint]]
124124
== OAuth2 Device Authorization Endpoint
125125

126-
`OAuth2DeviceAuthorizationEndpointConfigurer` provides the ability to customize the https://datatracker.ietf.org/doc/html/rfc8628#section-3.1[OAuth2 Device Authorization Endpoint].
126+
`OAuth2DeviceAuthorizationEndpointConfigurer` provides the ability to customize the https://datatracker.ietf.org/doc/html/rfc8628#section-3.1[OAuth2 Device Authorization endpoint].
127127
It defines extension points that let you customize the pre-processing, main processing, and post-processing logic for OAuth2 device authorization requests.
128128

129129
`OAuth2DeviceAuthorizationEndpointConfigurer` provides the following configuration options:
@@ -145,7 +145,7 @@ public SecurityFilterChain authorizationServerSecurityFilterChain(HttpSecurity h
145145
.authenticationProviders(authenticationProvidersConsumer) <4>
146146
.deviceAuthorizationResponseHandler(deviceAuthorizationResponseHandler) <5>
147147
.errorResponseHandler(errorResponseHandler) <6>
148-
.verificationUri("/oauth2/v1/device_authorization") <7>
148+
.verificationUri("/oauth2/v1/device_verification") <7>
149149
);
150150
151151
return http.build();

0 commit comments

Comments
 (0)