public static final class SecurityMockMvcRequestPostProcessors.OAuth2LoginRequestPostProcessor
extends java.lang.Object
implements org.springframework.test.web.servlet.request.RequestPostProcessor
| Modifier and Type | Method and Description |
|---|---|
SecurityMockMvcRequestPostProcessors.OAuth2LoginRequestPostProcessor |
attributes(java.util.function.Consumer<java.util.Map<java.lang.String,java.lang.Object>> attributesConsumer)
Mutate the attributes using the given
Consumer |
SecurityMockMvcRequestPostProcessors.OAuth2LoginRequestPostProcessor |
authorities(java.util.Collection<org.springframework.security.core.GrantedAuthority> authorities)
Use the provided authorities in the
Authentication |
SecurityMockMvcRequestPostProcessors.OAuth2LoginRequestPostProcessor |
authorities(org.springframework.security.core.GrantedAuthority... authorities)
Use the provided authorities in the
Authentication |
SecurityMockMvcRequestPostProcessors.OAuth2LoginRequestPostProcessor |
clientRegistration(org.springframework.security.oauth2.client.registration.ClientRegistration clientRegistration)
Use the provided
ClientRegistration as the client to authorize. |
SecurityMockMvcRequestPostProcessors.OAuth2LoginRequestPostProcessor |
oauth2User(org.springframework.security.oauth2.core.user.OAuth2User oauth2User)
Use the provided
OAuth2User as the authenticated user. |
org.springframework.mock.web.MockHttpServletRequest |
postProcessRequest(org.springframework.mock.web.MockHttpServletRequest request) |
public SecurityMockMvcRequestPostProcessors.OAuth2LoginRequestPostProcessor authorities(java.util.Collection<org.springframework.security.core.GrantedAuthority> authorities)
Authenticationauthorities - the authorities to useSecurityMockMvcRequestPostProcessors.OAuth2LoginRequestPostProcessor for further configurationpublic SecurityMockMvcRequestPostProcessors.OAuth2LoginRequestPostProcessor authorities(org.springframework.security.core.GrantedAuthority... authorities)
Authenticationauthorities - the authorities to useSecurityMockMvcRequestPostProcessors.OAuth2LoginRequestPostProcessor for further configurationpublic SecurityMockMvcRequestPostProcessors.OAuth2LoginRequestPostProcessor attributes(java.util.function.Consumer<java.util.Map<java.lang.String,java.lang.Object>> attributesConsumer)
ConsumerattributesConsumer - The Consumer for mutating the of attributesSecurityMockMvcRequestPostProcessors.OAuth2LoginRequestPostProcessor for further configurationpublic SecurityMockMvcRequestPostProcessors.OAuth2LoginRequestPostProcessor oauth2User(org.springframework.security.oauth2.core.user.OAuth2User oauth2User)
OAuth2User as the authenticated user.oauth2User - the OAuth2User to useSecurityMockMvcRequestPostProcessors.OAuth2LoginRequestPostProcessor for further configurationpublic SecurityMockMvcRequestPostProcessors.OAuth2LoginRequestPostProcessor clientRegistration(org.springframework.security.oauth2.client.registration.ClientRegistration clientRegistration)
ClientRegistration as the client to authorize.
The supplied ClientRegistration will be registered into an
HttpSessionOAuth2AuthorizedClientRepository. Tests relying on
org.springframework.security.oauth2.client.annotation.RegisteredOAuth2AuthorizedClient
annotations should register an HttpSessionOAuth2AuthorizedClientRepository bean
to the application context.clientRegistration - the ClientRegistration to useSecurityMockMvcRequestPostProcessors.OAuth2LoginRequestPostProcessor 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