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
FieldsModifier and TypeFieldDescriptionprivate static final StringLocation of the demo page and its script in the classpath.static final StringPath of the demo page and its script.static final intOrder of the customizer of the login chain that opens the demo page, after the existing ones.static final StringName of the profile that enables the flow. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddResourceHandlers(org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry registry) Serves the demo page and its script from the classpath.voidaddViewControllers(org.springframework.web.servlet.config.annotation.ViewControllerRegistry registry) Serves the demo page at the directory path.legacyImplicitClientSeeder(SeedRegisteredClientsUseCase seedRegisteredClientsUseCase, LegacyImplicitProperties properties) 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, waitMethods 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
Name of the profile that enables the flow.- See Also:
-
DEMO_PATH
Path of the demo page and its script.- See Also:
-
LOGIN_CUSTOMIZER_ORDER
public static final int LOGIN_CUSTOMIZER_ORDEROrder of the customizer of the login chain that opens the demo page, after the existing ones.- See Also:
-
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
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:
addResourceHandlersin interfaceorg.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:
addViewControllersin interfaceorg.springframework.web.servlet.config.annotation.WebMvcConfigurer- Parameters:
registry- the registry of view controllers.
-