Class X509UserDetailsService

java.lang.Object
com.irurueta.authserver.authorization.api.web.x509.X509UserDetailsService
All Implemented Interfaces:
org.springframework.security.core.userdetails.AuthenticationUserDetailsService<org.springframework.security.web.authentication.preauth.PreAuthenticatedAuthenticationToken>

public class X509UserDetailsService extends Object implements org.springframework.security.core.userdetails.AuthenticationUserDetailsService<org.springframework.security.web.authentication.preauth.PreAuthenticatedAuthenticationToken>
Loads the account a client certificate is bound to. The principal of the pre-authenticated token is the fingerprint the CertificatePrincipalExtractor took, which ResolveCertificateLoginUseCase maps to the account; the account is then loaded through a UserDetailsService that refuses a disabled, locked or expired one, as the other sign-in methods do.
  • Field Details

    • resolveCertificateLoginUseCase

      private final ResolveCertificateLoginUseCase resolveCertificateLoginUseCase
      Finds the account a certificate is bound to.
    • userDetailsService

      private final org.springframework.security.core.userdetails.UserDetailsService userDetailsService
      Loads the account, refusing one that cannot sign in.
  • Constructor Details

    • X509UserDetailsService

      public X509UserDetailsService()
  • Method Details

    • loadUserDetails

      public org.springframework.security.core.userdetails.UserDetails loadUserDetails(org.springframework.security.web.authentication.preauth.PreAuthenticatedAuthenticationToken token) throws org.springframework.security.core.userdetails.UsernameNotFoundException
      Loads the account of a certificate.
      Specified by:
      loadUserDetails in interface org.springframework.security.core.userdetails.AuthenticationUserDetailsService<org.springframework.security.web.authentication.preauth.PreAuthenticatedAuthenticationToken>
      Parameters:
      token - the token whose principal is the fingerprint of the certificate.
      Returns:
      the account.
      Throws:
      org.springframework.security.core.userdetails.UsernameNotFoundException - if the certificate is not bound to any account.
      org.springframework.security.authentication.AccountStatusException - if the account cannot sign in.