Skip to content

Commit ce09f3e

Browse files
committed
Polish gh-10373
1 parent 246df9f commit ce09f3e

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

docs/modules/ROOT/nav.adoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@
9393
** Authorization
9494
*** xref:reactive/authorization/method.adoc[EnableReactiveMethodSecurity]
9595
** xref:reactive/oauth2/index.adoc[OAuth2]
96-
*** xref:reactive/oauth2/login.adoc[OAuth 2.0 Login]
96+
*** xref:reactive/oauth2/login.adoc[OAuth2 Log In]
9797
*** xref:reactive/oauth2/oauth2-client.adoc[OAuth2 Client]
98-
*** xref:reactive/oauth2/resource-server.adoc[OAuth 2.0 Resource Server]
98+
*** xref:reactive/oauth2/resource-server.adoc[OAuth2 Resource Server]
9999
*** xref:reactive/registered-oauth2-authorized-client.adoc[@RegisteredOAuth2AuthorizedClient]
100100
** xref:reactive/exploits/index.adoc[Protection Against Exploits]
101101
*** xref:reactive/exploits/csrf.adoc[CSRF]

docs/modules/ROOT/pages/reactive/oauth2/index.adoc

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33

44
Spring Security provides OAuth2 and WebFlux integration for reactive applications.
55

6-
* xref:reactive/oauth2/login.adoc[OAuth 2.0 Login] - Authenticating with OAuth 2.0
7-
* xref:reactive/oauth2/oauth2-client.adoc[OAuth2 Client] - Making requests to an OAuth2 Resource Server as an OAuth2 Client
8-
* xref:reactive/oauth2/resource-server.adoc[OAuth 2.0 Resource Server] - protecting a REST endpoint using OAuth 2.0
6+
* xref:reactive/oauth2/login.adoc[OAuth2 Log In] - Authenticating with an OAuth2 or OpenID Connect 1.0 Provider
7+
* xref:reactive/oauth2/oauth2-client.adoc[OAuth2 Client] - Making requests to an OAuth2 Resource Server
8+
* xref:reactive/oauth2/resource-server.adoc[OAuth2 Resource Server] - Protecting a REST endpoint using OAuth2

docs/modules/ROOT/pages/reactive/oauth2/oauth2-client.adoc

+10-10
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ fun authorizedClientManager(
426426
----
427427
====
428428

429-
When an authorization attempt succeeds, the `DefaultReactiveOAuth2AuthorizedClientManager` will delegate to the `ReactiveOAuth2AuthorizationSuccessHandler`, which (by default) will save the `OAuth2AuthorizedClient` via the `ReactiveOAuth2AuthorizedClientProvider`.
429+
When an authorization attempt succeeds, the `DefaultReactiveOAuth2AuthorizedClientManager` will delegate to the `ReactiveOAuth2AuthorizationSuccessHandler`, which (by default) will save the `OAuth2AuthorizedClient` via the `ServerOAuth2AuthorizedClientRepository`.
430430
In the case of a re-authorization failure, eg. a refresh token is no longer valid, the previously saved `OAuth2AuthorizedClient` will be removed from the `ServerOAuth2AuthorizedClientRepository` via the `RemoveAuthorizedClientReactiveOAuth2AuthorizationFailureHandler`.
431431
The default behaviour may be customized via `setAuthorizationSuccessHandler(ReactiveOAuth2AuthorizationSuccessHandler)` and `setAuthorizationFailureHandler(ReactiveOAuth2AuthorizationFailureHandler)`.
432432

@@ -853,7 +853,7 @@ public class OAuth2ClientSecurityConfig {
853853
[source,kotlin,role="secondary"]
854854
----
855855
@EnableWebFluxSecurity
856-
class OAuth2ClientSecurityConfig : WebSecurityConfigurerAdapter() {
856+
class OAuth2ClientSecurityConfig {
857857
858858
@Bean
859859
fun securityFilterChain(http: ServerHttpSecurity): SecurityWebFilterChain {
@@ -940,14 +940,14 @@ class OAuth2ClientSecurityConfig {
940940
fun securityFilterChain(http: ServerHttpSecurity): SecurityWebFilterChain {
941941
http {
942942
oauth2Client {
943-
authenticationManager = authorizationGrantAuthenticationManager()
943+
authenticationManager = authorizationCodeAuthenticationManager()
944944
}
945945
}
946946
947947
return http.build()
948948
}
949949
950-
private fun authorizationGrantAuthenticationManager(): ReactiveAuthenticationManager {
950+
private fun authorizationCodeAuthenticationManager(): ReactiveAuthenticationManager {
951951
val accessTokenResponseClient = WebClientReactiveAuthorizationCodeTokenResponseClient()
952952
...
953953
@@ -1780,7 +1780,7 @@ spring:
17801780
...
17811781
----
17821782

1783-
The following example shows how to configure `DefaultClientCredentialsTokenResponseClient`:
1783+
The following example shows how to configure `WebClientReactiveClientCredentialsTokenResponseClient`:
17841784

17851785
====
17861786
.Java
@@ -1798,8 +1798,8 @@ Function<ClientRegistration, JWK> jwkResolver = (clientRegistration) -> {
17981798
return null;
17991799
};
18001800
1801-
WebClientReactiveAuthorizationCodeTokenResponseClient tokenResponseClient =
1802-
new WebClientReactiveAuthorizationCodeTokenResponseClient();
1801+
WebClientReactiveClientCredentialsTokenResponseClient tokenResponseClient =
1802+
new WebClientReactiveClientCredentialsTokenResponseClient();
18031803
tokenResponseClient.addParametersConverter(
18041804
new NimbusJwtClientAuthenticationParametersConverter<>(jwkResolver));
18051805
----
@@ -1820,7 +1820,7 @@ val jwkResolver = Function<ClientRegistration, JWK?> { clientRegistration: Clien
18201820
null
18211821
}
18221822
1823-
val tokenResponseClient = WebClientReactiveAuthorizationCodeTokenResponseClient()
1823+
val tokenResponseClient = WebClientReactiveClientCredentialsTokenResponseClient()
18241824
tokenResponseClient.addParametersConverter(
18251825
NimbusJwtClientAuthenticationParametersConverter(jwkResolver)
18261826
)
@@ -1869,7 +1869,7 @@ class OAuth2ClientController {
18691869
----
18701870
====
18711871

1872-
The `@RegisteredOAuth2AuthorizedClient` annotation is handled by `OAuth2AuthorizedClientArgumentResolver`, which directly uses an <<oauth2Client-authorized-manager-provider, ReactiveOAuth2AuthorizedClientManager>> and therefore inherits it's capabilities.
1872+
The `@RegisteredOAuth2AuthorizedClient` annotation is handled by `OAuth2AuthorizedClientArgumentResolver`, which directly uses a <<oauth2Client-authorized-manager-provider, ReactiveOAuth2AuthorizedClientManager>> and therefore inherits it's capabilities.
18731873

18741874

18751875
[[oauth2Client-webclient-webflux]]
@@ -1926,7 +1926,7 @@ The following code shows how to set an `OAuth2AuthorizedClient` as a request att
19261926
[source,java,role="primary"]
19271927
----
19281928
@GetMapping("/")
1929-
public Mono<String> index(@RegisteredOAuth2AuthorizedClient("test-client") OAuth2AuthorizedClient authorizedClient) {
1929+
public Mono<String> index(@RegisteredOAuth2AuthorizedClient("okta") OAuth2AuthorizedClient authorizedClient) {
19301930
String resourceUri = ...
19311931
19321932
return webClient

0 commit comments

Comments
 (0)