It would be handy in tests to be able to specify a Jwt authentication in tests:
this.mockMvc.perform(get("/")
.with(jwt()))
.andExcept(status().isOk());
Some features we should consider:
- Providing a completely instantiated
Jwt:
Jwt jwt = ...;
this.mockMvc.perform(get("/")
.with(jwt(jwt)))
...
Jwt jwt = ...;
this.mockMvc.perform(get("/")
.with(jwt(jwt).authorities("SCOPE_message:read"))
...
this.mockMvc.perform(get("/")
.with(jwt().claim(SUB, "the-subject")))
...
this.mockMvc.perform(get("/")
.with(jwt().header("alg", RS256)))
...
These would result in the SecurityContext containing an instance of JwtAuthenticationToken.
Also, we should introduce its reactive equivalent.
It would be handy in tests to be able to specify a
Jwtauthentication in tests:Some features we should consider:
Jwt:These would result in the
SecurityContextcontaining an instance ofJwtAuthenticationToken.Also, we should introduce its reactive equivalent.