Class CreateClientUseCase
java.lang.Object
com.irurueta.authserver.authorization.application.clients.CreateClientUseCase
Use case that registers a client. A client that authenticates with a
client_secret_* method gets a
generated secret, stored encoded and returned in clear text only once; a public client and a client that
authenticates with private_key_jwt or mutual TLS only has none.-
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
-
CreateClientUseCase
public CreateClientUseCase()
-
-
Method Details
-
execute
Registers a client.- Parameters:
registration- the client.- Returns:
- the stored client and, for a client that uses a secret, its generated secret;
nullwhen the client has noclient_secret_*authentication method. - Throws:
ClientAlreadyExistsException- if the client id is taken.ImplicitClientRefusedException- if the client has the implicit grant type.
-