public static final class SecurityMockMvcRequestPostProcessors.JwtRequestPostProcessor
extends java.lang.Object
implements org.springframework.test.web.servlet.request.RequestPostProcessor
| Modifier and Type | Method and Description |
|---|---|
SecurityMockMvcRequestPostProcessors.JwtRequestPostProcessor |
authorities(java.util.Collection<org.springframework.security.core.GrantedAuthority> authorities)
Use the provided authorities in the token
|
SecurityMockMvcRequestPostProcessors.JwtRequestPostProcessor |
authorities(org.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt,java.util.Collection<org.springframework.security.core.GrantedAuthority>> authoritiesConverter)
Provides the configured
Jwt so that custom authorities can be derived
from it |
SecurityMockMvcRequestPostProcessors.JwtRequestPostProcessor |
authorities(org.springframework.security.core.GrantedAuthority... authorities)
Use the provided authorities in the token
|
SecurityMockMvcRequestPostProcessors.JwtRequestPostProcessor |
jwt(java.util.function.Consumer<org.springframework.security.oauth2.jwt.Jwt.Builder> jwtBuilderConsumer)
Use the given
Jwt.Builder Consumer to configure the underlying Jwt
This method first creates a default Jwt.Builder instance with default values for
the alg, sub, and scope claims. |
SecurityMockMvcRequestPostProcessors.JwtRequestPostProcessor |
jwt(org.springframework.security.oauth2.jwt.Jwt jwt)
Use the given
Jwt |
org.springframework.mock.web.MockHttpServletRequest |
postProcessRequest(org.springframework.mock.web.MockHttpServletRequest request) |
public SecurityMockMvcRequestPostProcessors.JwtRequestPostProcessor jwt(java.util.function.Consumer<org.springframework.security.oauth2.jwt.Jwt.Builder> jwtBuilderConsumer)
Jwt.Builder Consumer to configure the underlying Jwt
This method first creates a default Jwt.Builder instance with default values for
the alg, sub, and scope claims. The Consumer can then modify
these or provide additional configuration.
Calling SecurityMockMvcRequestPostProcessors.jwt() is the equivalent of calling
SecurityMockMvcRequestPostProcessors.jwt().jwt(() -> {}).jwtBuilderConsumer - For configuring the underlying JwtSecurityMockMvcRequestPostProcessors.JwtRequestPostProcessor for additional customizationpublic SecurityMockMvcRequestPostProcessors.JwtRequestPostProcessor jwt(org.springframework.security.oauth2.jwt.Jwt jwt)
Jwtjwt - The Jwt to useSecurityMockMvcRequestPostProcessors.JwtRequestPostProcessor for additional customizationpublic SecurityMockMvcRequestPostProcessors.JwtRequestPostProcessor authorities(java.util.Collection<org.springframework.security.core.GrantedAuthority> authorities)
authorities - the authorities to useSecurityMockMvcRequestPostProcessors.JwtRequestPostProcessor for further configurationpublic SecurityMockMvcRequestPostProcessors.JwtRequestPostProcessor authorities(org.springframework.security.core.GrantedAuthority... authorities)
authorities - the authorities to useSecurityMockMvcRequestPostProcessors.JwtRequestPostProcessor for further configurationpublic SecurityMockMvcRequestPostProcessors.JwtRequestPostProcessor authorities(org.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt,java.util.Collection<org.springframework.security.core.GrantedAuthority>> authoritiesConverter)
Jwt so that custom authorities can be derived
from itauthoritiesConverter - the conversion strategy from Jwt to a Collection
of GrantedAuthoritysSecurityMockMvcRequestPostProcessors.JwtRequestPostProcessor for further configurationpublic org.springframework.mock.web.MockHttpServletRequest postProcessRequest(org.springframework.mock.web.MockHttpServletRequest request)
postProcessRequest in interface org.springframework.test.web.servlet.request.RequestPostProcessor