Class SecurityMockMvcRequestPostProcessors.OpaqueTokenRequestPostProcessor
java.lang.Object
org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.OpaqueTokenRequestPostProcessor
- All Implemented Interfaces:
org.springframework.test.web.servlet.request.RequestPostProcessor
- Enclosing class:
- SecurityMockMvcRequestPostProcessors
public static final class SecurityMockMvcRequestPostProcessors.OpaqueTokenRequestPostProcessor
extends Object
implements org.springframework.test.web.servlet.request.RequestPostProcessor
- Since:
- 5.3
-
Method Summary
Modifier and TypeMethodDescriptionattributes(Consumer<Map<String, Object>> attributesConsumer) Mutate the attributes using the givenConsumerauthorities(Collection<org.springframework.security.core.GrantedAuthority> authorities) Use the provided authorities in the resulting principalauthorities(org.springframework.security.core.GrantedAuthority... authorities) Use the provided authorities in the resulting principalorg.springframework.mock.web.MockHttpServletRequestpostProcessRequest(org.springframework.mock.web.MockHttpServletRequest request) principal(org.springframework.security.oauth2.core.OAuth2AuthenticatedPrincipal principal) Use the provided principal
-
Method Details
-
attributes
public SecurityMockMvcRequestPostProcessors.OpaqueTokenRequestPostProcessor attributes(Consumer<Map<String, Object>> attributesConsumer) Mutate the attributes using the givenConsumer- Parameters:
attributesConsumer- TheConsumerfor mutating theMapof attributes- Returns:
- the
SecurityMockMvcRequestPostProcessors.OpaqueTokenRequestPostProcessorfor further configuration
-
authorities
public SecurityMockMvcRequestPostProcessors.OpaqueTokenRequestPostProcessor authorities(Collection<org.springframework.security.core.GrantedAuthority> authorities) Use the provided authorities in the resulting principal- Parameters:
authorities- the authorities to use- Returns:
- the
SecurityMockMvcRequestPostProcessors.OpaqueTokenRequestPostProcessorfor further configuration
-
authorities
public SecurityMockMvcRequestPostProcessors.OpaqueTokenRequestPostProcessor authorities(org.springframework.security.core.GrantedAuthority... authorities) Use the provided authorities in the resulting principal- Parameters:
authorities- the authorities to use- Returns:
- the
SecurityMockMvcRequestPostProcessors.OpaqueTokenRequestPostProcessorfor further configuration
-
principal
public SecurityMockMvcRequestPostProcessors.OpaqueTokenRequestPostProcessor principal(org.springframework.security.oauth2.core.OAuth2AuthenticatedPrincipal principal) Use the provided principal- Parameters:
principal- the principal to use- Returns:
- the
SecurityMockMvcRequestPostProcessors.OpaqueTokenRequestPostProcessorfor further configuration
-
postProcessRequest
public org.springframework.mock.web.MockHttpServletRequest postProcessRequest(org.springframework.mock.web.MockHttpServletRequest request) - Specified by:
postProcessRequestin interfaceorg.springframework.test.web.servlet.request.RequestPostProcessor
-