Class LegacyImplicitConfiguration

java.lang.Object
com.irurueta.authserver.authorization.api.web.implicit.LegacyImplicitConfiguration
All Implemented Interfaces:
org.springframework.web.servlet.config.annotation.WebMvcConfigurer

@Profile("legacy-implicit") @Configuration(proxyBeanMethods=false) @EnableConfigurationProperties(LegacyImplicitProperties.class) public class LegacyImplicitConfiguration extends Object implements org.springframework.web.servlet.config.annotation.WebMvcConfigurer
Enables the legacy implicit flow. It exists only under the legacy-implicit profile, as a demonstration of the risks that made OAuth 2.1 remove it, and never in a deployment: the authorization endpoint accepts response_type=token for one client, the client is seeded, and a demo page is served.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final String
    Location of the demo page and its script in the classpath.
    static final String
    Path of the demo page and its script.
    static final int
    Order of the customizer of the login chain that opens the demo page, after the existing ones.
    static final String
    Name of the profile that enables the flow.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addResourceHandlers(org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry registry)
    Serves the demo page and its script from the classpath.
    void
    addViewControllers(org.springframework.web.servlet.config.annotation.ViewControllerRegistry registry)
    Serves the demo page at the directory path.
    Declares the seeder of the client of the flow.
    Declares the customizer of the login chain that opens the demo page and its script, which are static files that a browser fetches before anybody has signed in.
    legacyImplicitProtocolChainCustomizer(org.springframework.security.oauth2.server.authorization.client.RegisteredClientRepository registeredClients, org.springframework.security.oauth2.server.authorization.OAuth2AuthorizationService authorizationService, LegacyImplicitTokenGeneratorFactory generatorFactory, org.springframework.security.oauth2.server.authorization.settings.AuthorizationServerSettings serverSettings, MfaAuthorizationManager authorizationManager, LegacyImplicitProperties properties)
    Declares the customizer that adds the flow to the authorization endpoint.
    legacyImplicitTokenGeneratorFactory(org.springframework.security.oauth2.jwt.JwtEncoder jwtEncoder, org.springframework.beans.factory.ObjectProvider<org.springframework.security.oauth2.server.authorization.token.OAuth2TokenCustomizer<org.springframework.security.oauth2.server.authorization.token.JwtEncodingContext>> jwtCustomizers, org.springframework.beans.factory.ObjectProvider<org.springframework.security.oauth2.server.authorization.token.OAuth2TokenCustomizer<org.springframework.security.oauth2.server.authorization.token.OAuth2TokenClaimsContext>> claimsCustomizers)
    Declares the factory of the token generator of the flow.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.springframework.web.servlet.config.annotation.WebMvcConfigurer

    addArgumentResolvers, addCorsMappings, addErrorResponseInterceptors, addFormatters, addInterceptors, addReturnValueHandlers, configureApiVersioning, configureAsyncSupport, configureContentNegotiation, configureDefaultServletHandling, configureHandlerExceptionResolvers, configureMessageConverters, configureMessageConverters, configurePathMatch, configureViewResolvers, extendHandlerExceptionResolvers, extendMessageConverters, getMessageCodesResolver, getValidator
  • Field Details

    • PROFILE

      public static final String PROFILE
      Name of the profile that enables the flow.
      See Also:
    • DEMO_PATH

      public static final String DEMO_PATH
      Path of the demo page and its script.
      See Also:
    • LOGIN_CUSTOMIZER_ORDER

      public static final int LOGIN_CUSTOMIZER_ORDER
      Order of the customizer of the login chain that opens the demo page, after the existing ones.
      See Also:
    • DEMO_LOCATION

      private static final String DEMO_LOCATION
      Location of the demo page and its script in the classpath.
      See Also:
  • Constructor Details

    • LegacyImplicitConfiguration

      public LegacyImplicitConfiguration()
  • Method Details

    • legacyImplicitTokenGeneratorFactory

      @Bean public LegacyImplicitTokenGeneratorFactory legacyImplicitTokenGeneratorFactory(org.springframework.security.oauth2.jwt.JwtEncoder jwtEncoder, org.springframework.beans.factory.ObjectProvider<org.springframework.security.oauth2.server.authorization.token.OAuth2TokenCustomizer<org.springframework.security.oauth2.server.authorization.token.JwtEncodingContext>> jwtCustomizers, org.springframework.beans.factory.ObjectProvider<org.springframework.security.oauth2.server.authorization.token.OAuth2TokenCustomizer<org.springframework.security.oauth2.server.authorization.token.OAuth2TokenClaimsContext>> claimsCustomizers)
      Declares the factory of the token generator of the flow.
      Parameters:
      jwtEncoder - signs the self-contained tokens.
      jwtCustomizers - adds the claims of the other flows to a JWT.
      claimsCustomizers - adds the claims of the other flows to a reference token.
      Returns:
      the factory.
    • legacyImplicitProtocolChainCustomizer

      @Bean @Order(4) public ProtocolChainCustomizer legacyImplicitProtocolChainCustomizer(org.springframework.security.oauth2.server.authorization.client.RegisteredClientRepository registeredClients, org.springframework.security.oauth2.server.authorization.OAuth2AuthorizationService authorizationService, LegacyImplicitTokenGeneratorFactory generatorFactory, org.springframework.security.oauth2.server.authorization.settings.AuthorizationServerSettings serverSettings, MfaAuthorizationManager authorizationManager, LegacyImplicitProperties properties)
      Declares the customizer that adds the flow to the authorization endpoint.
      Parameters:
      registeredClients - finds the client.
      authorizationService - stores the authorization behind the token.
      generatorFactory - builds the token generator.
      serverSettings - settings of the protocol endpoints, for the authorization endpoint.
      authorizationManager - applies the multi-factor policy.
      properties - settings of the flow.
      Returns:
      the customizer.
    • legacyImplicitClientSeeder

      @Bean public LegacyImplicitClientSeeder legacyImplicitClientSeeder(SeedRegisteredClientsUseCase seedRegisteredClientsUseCase, LegacyImplicitProperties properties)
      Declares the seeder of the client of the flow.
      Parameters:
      seedRegisteredClientsUseCase - seeds the clients.
      properties - settings of the flow.
      Returns:
      the seeder.
    • legacyImplicitLoginChainCustomizer

      @Bean @Order(8) public LoginChainCustomizer legacyImplicitLoginChainCustomizer()
      Declares the customizer of the login chain that opens the demo page and its script, which are static files that a browser fetches before anybody has signed in.
      Returns:
      the customizer.
    • addResourceHandlers

      public void addResourceHandlers(org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry registry)
      Serves the demo page and its script from the classpath.
      Specified by:
      addResourceHandlers in interface org.springframework.web.servlet.config.annotation.WebMvcConfigurer
      Parameters:
      registry - the registry of resource handlers.
    • addViewControllers

      public void addViewControllers(org.springframework.web.servlet.config.annotation.ViewControllerRegistry registry)
      Serves the demo page at the directory path.
      Specified by:
      addViewControllers in interface org.springframework.web.servlet.config.annotation.WebMvcConfigurer
      Parameters:
      registry - the registry of view controllers.