Class RotateClientSecretUseCase

java.lang.Object
com.irurueta.authserver.authorization.application.clients.RotateClientSecretUseCase

@Service @Transactional public class RotateClientSecretUseCase extends Object
Use case that replaces the secret of a client that authenticates with a client secret with a new generated one.
  • Field Details

    • clientRegistrationRepository

      private final ClientRegistrationRepository clientRegistrationRepository
      Port that stores the clients.
    • passwordHasher

      private final PasswordHasher passwordHasher
      Port that encodes secrets.
    • clientSecretGenerator

      private final ClientSecretGenerator clientSecretGenerator
      Generator of client secrets.
  • Constructor Details

    • RotateClientSecretUseCase

      public RotateClientSecretUseCase()
  • Method Details

    • execute

      public String execute(String clientId)
      Rotates the secret of a client.
      Parameters:
      clientId - public identifier of the client.
      Returns:
      the new clear-text secret, shown only this once.
      Throws:
      ClientNotFoundException - if the client is not registered.
      IllegalArgumentException - if the client has no client_secret_* authentication method and so has no secret.