Isolate Jwt Test Support
Isolating Jwt test support inside JwtRequestPostProcessor and JwtMutator. Fixes gh-7641
This commit is contained in:
@@ -203,7 +203,7 @@ Any headers or claims can be configured with their corresponding methods:
|
||||
[source,java]
|
||||
----
|
||||
client
|
||||
.mutateWith(jwt(jwt -> jwt.header("kid", "one")
|
||||
.mutateWith(mockJwt().jwt(jwt -> jwt.header("kid", "one")
|
||||
.claim("iss", "https://idp.example.org")))
|
||||
.get().uri("/endpoint").exchange();
|
||||
----
|
||||
@@ -211,7 +211,7 @@ client
|
||||
[source,java]
|
||||
----
|
||||
client
|
||||
.mutateWith(jwt(jwt -> jwt.claims(claims -> claims.remove("scope"))))
|
||||
.mutateWith(mockJwt().jwt(jwt -> jwt.claims(claims -> claims.remove("scope"))))
|
||||
.get().uri("/endpoint").exchange();
|
||||
----
|
||||
|
||||
@@ -244,7 +244,7 @@ Jwt jwt = Jwt.withTokenValue("token")
|
||||
.claim("scope", "read");
|
||||
|
||||
client
|
||||
.mutateWith(jwt(jwt))
|
||||
.mutateWith(mockJwt().jwt(jwt))
|
||||
.get().uri("/endpoint").exchange();
|
||||
----
|
||||
|
||||
|
||||
@@ -335,14 +335,14 @@ Any headers or claims can be configured with their corresponding methods:
|
||||
----
|
||||
mvc
|
||||
.perform(get("/endpoint")
|
||||
.with(jwt(jwt -> jwt.header("kid", "one").claim("iss", "https://idp.example.org"))));
|
||||
.with(jwt().jwt(jwt -> jwt.header("kid", "one").claim("iss", "https://idp.example.org"))));
|
||||
----
|
||||
|
||||
[source,java]
|
||||
----
|
||||
mvc
|
||||
.perform(get("/endpoint")
|
||||
.with(jwt(jwt -> jwt.claims(claims -> claims.remove("scope")))));
|
||||
.with(jwt().jwt(jwt -> jwt.claims(claims -> claims.remove("scope")))));
|
||||
----
|
||||
|
||||
The `scope` and `scp` claims are processed the same way here as they are in a normal bearer token request.
|
||||
@@ -375,7 +375,7 @@ Jwt jwt = Jwt.withTokenValue("token")
|
||||
|
||||
mvc
|
||||
.perform(get("/endpoint")
|
||||
.with(jwt(jwt)));
|
||||
.with(jwt().jwt(jwt)));
|
||||
----
|
||||
|
||||
===== `authentication()` `RequestPostProcessor`
|
||||
|
||||
Reference in New Issue
Block a user