Class MockMvcOAuth2AuthenticationUtil
java.lang.Object
com.broadleafcommerce.oauth2.resource.security.test.MockMvcOAuth2AuthenticationUtil
- Direct Known Subclasses:
VendorMockMvcOAuth2AuthenticationUtil
A bean providing simple mocking of OAuth2 access tokens for security tests with MockMVC. Required
for authentication to succeed from the BearerTokenAuthenticationFilter
when stateless =
true.
This originally comes from JHipster, see https://github.com/jhipster/generator-jhipster/pull/4066 for more details about the original context of this support.
This is required to be an @Configuration class because of the @MockBean
usage. This is automatically done via the MockOauth2ResourceServerAutoConfiguration
.
- Author:
- Phillip Verheyden (phillipuniverse)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.test.web.servlet.request.RequestPostProcessor
withAuthentication
(Set<String> scopes, Set<String> authorities, Set<String> applications, String tenant, Boolean isGlobal, String username, String userId) org.springframework.test.web.servlet.request.RequestPostProcessor
withAuthentication
(Set<String> scopes, Set<String> authorities, Set<String> applications, String tenant, Boolean isGlobal, String username, String userId, Map<String, Object> authDetails) org.springframework.test.web.servlet.request.RequestPostProcessor
withAuthorities
(Set<String> authorities) org.springframework.test.web.servlet.request.RequestPostProcessor
org.springframework.test.web.servlet.request.RequestPostProcessor
withAuthoritiesAndTenant
(Set<String> authorities, String tenant) org.springframework.test.web.servlet.request.RequestPostProcessor
withAuthoritiesAndTenant
(Set<String> authorities, Set<String> applications, Boolean isGlobal, String user) org.springframework.test.web.servlet.request.RequestPostProcessor
withAuthoritiesAndTenant
(Set<String> authorities, Set<String> applications, Boolean isGlobal, String username, String userId) org.springframework.test.web.servlet.request.RequestPostProcessor
withAuthoritiesAndTenant
(Set<String> authorities, Set<String> applications, String tenant, Boolean isGlobal, String user) org.springframework.test.web.servlet.request.RequestPostProcessor
withAuthoritiesAndTenant
(Set<String> authorities, Set<String> applications, String tenant, Boolean isGlobal, String username, String userId) org.springframework.test.web.servlet.request.RequestPostProcessor
withScopes
(Set<String> scopes)
-
Constructor Details
-
MockMvcOAuth2AuthenticationUtil
public MockMvcOAuth2AuthenticationUtil()
-
-
Method Details
-
withAuthentication
-
withAuthentication
-
withScopes
-
withAuthorities
-
withAuthoritiesAndTenant
-
withAuthoritiesAndTenant
-
withAuthoritiesAndDetails
-
withAuthoritiesAndTenant
-
withAuthoritiesAndTenant
-
withAuthoritiesAndTenant
-