Class UnbindCertificateUseCase

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

@Service @Transactional public class UnbindCertificateUseCase extends Object
Use case that unbinds a client certificate from an account and audits it. Like unlinking an identity, it refuses to remove the last way to sign in, counted under the lock of LockSignInMethodsUseCase so that concurrent removals of the same account are serialized.
  • Field Details

    • certificateBindingRepository

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

      private final LockSignInMethodsUseCase lockSignInMethodsUseCase
      Locks and counts the sign-in methods of the account.
    • federatedLinkingPolicy

      private final FederatedLinkingPolicy federatedLinkingPolicy
      Rules of removing a sign-in method.
    • recordSecurityEventUseCase

      private final RecordSecurityEventUseCase recordSecurityEventUseCase
      Use case that records the audit events.
  • Constructor Details

    • UnbindCertificateUseCase

      public UnbindCertificateUseCase()
  • Method Details

    • execute

      public void execute(UUID userId, String username, UUID id)
      Unbinds a certificate; a certificate of another account is never touched.
      Parameters:
      userId - identifier of the account.
      username - name of the account, for the audit log.
      id - identifier of the binding.
      Throws:
      CertificateNotFoundException - if the account has no such binding.
      LastSignInMethodException - if the certificate is the last way the account can sign in.