Class SecurityMockServerConfigurers.OAuth2LoginMutator

java.lang.Object
org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.OAuth2LoginMutator
All Implemented Interfaces:
org.springframework.test.web.reactive.server.MockServerConfigurer, org.springframework.test.web.reactive.server.WebTestClientConfigurer
Enclosing class:
SecurityMockServerConfigurers

public static final class SecurityMockServerConfigurers.OAuth2LoginMutator extends Object implements org.springframework.test.web.reactive.server.WebTestClientConfigurer, org.springframework.test.web.reactive.server.MockServerConfigurer
Since:
5.3
  • Method Details

    • authorities

      public SecurityMockServerConfigurers.OAuth2LoginMutator authorities(Collection<org.springframework.security.core.GrantedAuthority> authorities)
      Use the provided authorities in the Authentication
      Parameters:
      authorities - the authorities to use
      Returns:
      the SecurityMockServerConfigurers.OAuth2LoginMutator for further configuration
    • authorities

      public SecurityMockServerConfigurers.OAuth2LoginMutator authorities(org.springframework.security.core.GrantedAuthority... authorities)
      Use the provided authorities in the Authentication
      Parameters:
      authorities - the authorities to use
      Returns:
      the SecurityMockServerConfigurers.OAuth2LoginMutator for further configuration
    • attributes

      Mutate the attributes using the given Consumer
      Parameters:
      attributesConsumer - The Consumer for mutating the Map of attributes
      Returns:
      the SecurityMockServerConfigurers.OAuth2LoginMutator for further configuration
    • oauth2User

      public SecurityMockServerConfigurers.OAuth2LoginMutator oauth2User(org.springframework.security.oauth2.core.user.OAuth2User oauth2User)
      Use the provided OAuth2User as the authenticated user.
      Parameters:
      oauth2User - the OAuth2User to use
      Returns:
      the SecurityMockServerConfigurers.OAuth2LoginMutator for further configuration
    • clientRegistration

      public SecurityMockServerConfigurers.OAuth2LoginMutator clientRegistration(org.springframework.security.oauth2.client.registration.ClientRegistration clientRegistration)
      Use the provided ClientRegistration as the client to authorize.

      The supplied ClientRegistration will be registered into a ServerOAuth2AuthorizedClientRepository.

      Parameters:
      clientRegistration - the ClientRegistration to use
      Returns:
      the SecurityMockServerConfigurers.OAuth2LoginMutator for further configuration
    • beforeServerCreated

      public void beforeServerCreated(org.springframework.web.server.adapter.WebHttpHandlerBuilder builder)
      Specified by:
      beforeServerCreated in interface org.springframework.test.web.reactive.server.MockServerConfigurer
    • afterConfigureAdded

      public void afterConfigureAdded(org.springframework.test.web.reactive.server.WebTestClient.MockServerSpec<?> serverSpec)
      Specified by:
      afterConfigureAdded in interface org.springframework.test.web.reactive.server.MockServerConfigurer
    • afterConfigurerAdded

      public void afterConfigurerAdded(org.springframework.test.web.reactive.server.WebTestClient.Builder builder, @Nullable org.springframework.web.server.adapter.WebHttpHandlerBuilder httpHandlerBuilder, @Nullable org.springframework.http.client.reactive.ClientHttpConnector connector)
      Specified by:
      afterConfigurerAdded in interface org.springframework.test.web.reactive.server.WebTestClientConfigurer