Class X509Configuration

java.lang.Object
com.irurueta.authserver.authorization.api.web.x509.X509Configuration

@Configuration(value="x509WebConfiguration", proxyBeanMethods=false) @ConditionalOnProperty(prefix="authserver.x509", name="enabled", havingValue="true") public class X509Configuration extends Object
Installs the sign-in with a client certificate in the login/UI chain, only while authserver.x509.enabled is true. Nothing outside this feature is edited: the chain applies every LoginChainCustomizer bean, in order, before its catch-all rule.
  • Constructor Details

    • X509Configuration

      public X509Configuration()
  • Method Details

    • certificatePrincipalExtractor

      @Bean public CertificatePrincipalExtractor certificatePrincipalExtractor()
      Declares the extractor that takes the fingerprint of the certificate as the principal.
      Returns:
      the extractor.
    • x509UserDetailsService

      @Bean public X509UserDetailsService x509UserDetailsService(ResolveCertificateLoginUseCase useCase, org.springframework.security.core.userdetails.UserDetailsService userDetailsService)
      Declares the service that loads the account a certificate is bound to, refusing one that cannot sign in.
      Parameters:
      useCase - finds the account of a fingerprint.
      userDetailsService - loads the accounts.
      Returns:
      the service.
    • devX509KeyStore

      @Bean @Profile("dev") public DevX509KeyStore devX509KeyStore()
      Declares the generator of the development key store of the TLS port, only under the dev profile.
      Returns:
      the generator.
    • x509TlsKeyStoreResolver

      @Bean public X509TlsKeyStoreResolver x509TlsKeyStoreResolver(X509Properties properties, org.springframework.beans.factory.ObjectProvider<DevX509KeyStore> developmentKeyStore)
      Declares the resolver of the key store of the TLS port.
      Parameters:
      properties - settings of the sign-in with a certificate.
      developmentKeyStore - the generator of the development key store, when the dev profile is active.
      Returns:
      the resolver.
    • x509TlsConnectorCustomizer

      @Bean public X509TlsConnectorCustomizer x509TlsConnectorCustomizer(X509Properties properties, X509TlsKeyStoreResolver keyStoreResolver)
      Declares the customizer that adds the dedicated TLS port, which does nothing while no port is configured.
      Parameters:
      properties - settings of the sign-in with a certificate.
      keyStoreResolver - finds the key store of the port.
      Returns:
      the customizer.
    • x509ForwardedHeadersGuard

      @Bean public X509ForwardedHeadersGuard x509ForwardedHeadersGuard(X509Properties properties, org.springframework.core.env.Environment environment)
      Declares the check that refuses a forwarded certificate while the server rewrites the address of its clients.
      Parameters:
      properties - settings of the sign-in with a certificate.
      environment - environment of the application, with the forwarded-header strategy.
      Returns:
      the check, which has already passed.
    • x509LoginMethodFragment

      @Bean public X509LoginMethodFragment x509LoginMethodFragment(X509Properties properties)
      Declares the button of the sign-in with a certificate on the login page.
      Parameters:
      properties - settings of the sign-in with a certificate, which tell where the form posts.
      Returns:
      the fragment.
    • x509ChainCustomizer

      @Bean @Order(6) public LoginChainCustomizer x509ChainCustomizer(CertificatePrincipalExtractor extractor, X509UserDetailsService userDetailsService, FactorGrantor grantor, X509Properties properties)
      Declares the customizer that enables http.x509(...). It is applied after the social login one.
      Parameters:
      extractor - takes the fingerprint of the certificate.
      userDetailsService - loads the account of the certificate.
      grantor - adds the factor authority.
      properties - settings, which tell whether a proxy may forward the certificate.
      Returns:
      the customizer.