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 Details

  • Constructor Details

    • WithMockOAuth2SecurityContextFactory

      public WithMockOAuth2SecurityContextFactory()
  • Method Details

    • createSecurityContext

      public org.springframework.security.core.context.SecurityContext createSecurityContext(WithMockOAuth2 mockOAuth2Scope)
      Specified by:
      createSecurityContext in interface org.springframework.security.test.context.support.WithSecurityContextFactory<WithMockOAuth2>
    • createAuthentication

      public org.springframework.security.oauth2.server.resource.authentication.BearerTokenAuthentication createAuthentication(Set<String> scopes, Set<String> authorities, String principal)
    • createAuthentication

      public org.springframework.security.oauth2.server.resource.authentication.BearerTokenAuthentication createAuthentication(Set<String> scopes, Set<String> authorities, String principal, @Nullable Map<String,Object> attributes)