Class WithMockOAuth2SecurityContextFactory
java.lang.Object
com.broadleafcommerce.oauth2.resource.security.test.WithMockOAuth2SecurityContextFactory
- All Implemented Interfaces:
org.springframework.security.test.context.support.WithSecurityContextFactory<WithMockOAuth2>
public class WithMockOAuth2SecurityContextFactory
extends Object
implements org.springframework.security.test.context.support.WithSecurityContextFactory<WithMockOAuth2>
Sets up the Spring Security context based on the given scopes.
- Author:
- Phillip Verheyden (phillipuniverse)
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.security.oauth2.server.resource.authentication.BearerTokenAuthentication
org.springframework.security.oauth2.server.resource.authentication.BearerTokenAuthentication
createAuthentication
(Set<String> scopes, Set<String> authorities, String principal, Map<String, Object> attributes) org.springframework.security.core.context.SecurityContext
createSecurityContext
(WithMockOAuth2 mockOAuth2Scope)
-
Field Details
-
MOCK_TOKEN
- See Also:
-
-
Constructor Details
-
WithMockOAuth2SecurityContextFactory
public WithMockOAuth2SecurityContextFactory()
-
-
Method Details
-
createSecurityContext
public org.springframework.security.core.context.SecurityContext createSecurityContext(WithMockOAuth2 mockOAuth2Scope) - Specified by:
createSecurityContext
in interfaceorg.springframework.security.test.context.support.WithSecurityContextFactory<WithMockOAuth2>
-
createAuthentication
-
createAuthentication
-