Class ResolveCertificateLoginUseCase

java.lang.Object
com.irurueta.authserver.authorization.application.x509.ResolveCertificateLoginUseCase

@Service @Transactional(readOnly=true) public class ResolveCertificateLoginUseCase extends Object
Use case that resolves a client certificate, presented over TLS or by a trusted proxy, to the account it is bound to. The certificate is recognised by its SHA-256 fingerprint only. Whether the certificate is valid (signed by a trusted authority, not expired) is decided before, by the TLS layer, never here.
  • Field Details

    • FINGERPRINT

      private static final Pattern FINGERPRINT
      Shape of a fingerprint: 64 lower case hexadecimal digits.
    • certificateBindingRepository

      private final CertificateBindingRepository certificateBindingRepository
      Port that stores the bindings.
    • userAccountRepository

      private final UserAccountRepository userAccountRepository
      Port that stores the accounts.
  • Constructor Details

    • ResolveCertificateLoginUseCase

      public ResolveCertificateLoginUseCase()
  • Method Details

    • execute

      public Optional<UserAccount> execute(String fingerprintSha256)
      Finds the account a certificate is bound to.
      Parameters:
      fingerprintSha256 - SHA-256 fingerprint of the certificate, as lower case hexadecimal digits.
      Returns:
      the account, or an empty optional when the fingerprint is malformed or not bound to any account.