Class RotateClientSecretUseCase
java.lang.Object
com.irurueta.authserver.authorization.application.clients.RotateClientSecretUseCase
Use case that replaces the secret of a client that authenticates with a client secret with a new generated one.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ClientRegistrationRepositoryPort that stores the clients.private final ClientSecretGeneratorGenerator of client secrets.private final PasswordHasherPort that encodes secrets. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
clientRegistrationRepository
Port that stores the clients. -
passwordHasher
Port that encodes secrets. -
clientSecretGenerator
Generator of client secrets.
-
-
Constructor Details
-
RotateClientSecretUseCase
public RotateClientSecretUseCase()
-
-
Method Details
-
execute
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 noclient_secret_*authentication method and so has no secret.
-