You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Updated all references to SecurityMockServerConfigurers to refer to
correct methods.
Added documentation for mockJwt to include the
SecurityMockServerConfigurers class.
Issue gh-10254
Copy file name to clipboardExpand all lines: docs/manual/src/docs/asciidoc/_includes/reactive/test.adoc
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -184,7 +184,7 @@ then Spring Security's test support can come in handy.
184
184
Testing the method above with `WebTestClient` would require simulating some kind of grant flow with an authorization server.
185
185
Certainly this would be a daunting task, which is why Spring Security ships with support for removing this boilerplate.
186
186
187
-
For example, we can tell Spring Security to include a default `OidcUser` using the `SecurityMockServerConfigurers#oidcLogin` method, like so:
187
+
For example, we can tell Spring Security to include a default `OidcUser` using the `SecurityMockServerConfigurers#mockOidcLogin` method, like so:
188
188
189
189
[source,java]
190
190
----
@@ -311,7 +311,7 @@ public Mono<String> foo(@AuthenticationPrincipal OAuth2User oauth2User) {
311
311
}
312
312
----
313
313
314
-
In that case, we can tell Spring Security to include a default `OAuth2User` using the `SecurityMockServerConfigurers#oauth2User` method, like so:
314
+
In that case, we can tell Spring Security to include a default `OAuth2User` using the `SecurityMockServerConfigurers#mockOAuth2Login` method, like so:
315
315
316
316
[source,java]
317
317
----
@@ -431,7 +431,7 @@ public Mono<String> foo(@RegisteredOAuth2AuthorizedClient("my-app") OAuth2Author
431
431
----
432
432
433
433
Simulating this handshake with the authorization server could be cumbersome.
434
-
Instead, you can use `SecurityMockServerConfigurers#oauth2Client` to add a `OAuth2AuthorizedClient` into an `WebSessionOAuth2ServerAuthorizedClientRepository`:
434
+
Instead, you can use `SecurityMockServerConfigurers#mockOAuth2Client` to add a `OAuth2AuthorizedClient` into a mock `ServerOAuth2AuthorizedClientRepository`:
435
435
436
436
[source,java]
437
437
----
@@ -555,7 +555,7 @@ We'll look at two of them now:
555
555
==== `mockJwt() WebTestClientConfigurer`
556
556
557
557
The first way is via a `WebTestClientConfigurer`.
558
-
The simplest of these would look something like this:
558
+
The simplest of these would be to use the `SecurityMockServerConfigurers#mockJwt` method like the following:
559
559
560
560
[source,java]
561
561
----
@@ -678,7 +678,7 @@ public Mono<String> foo(BearerTokenAuthentication authentication) {
678
678
}
679
679
----
680
680
681
-
In that case, we can tell Spring Security to include a default `BearerTokenAuthentication` using the `SecurityMockServerConfigurers#opaqueToken` method, like so:
681
+
In that case, we can tell Spring Security to include a default `BearerTokenAuthentication` using the `SecurityMockServerConfigurers#mockOpaqueToken` method, like so:
0 commit comments