Class SeedRegisteredClientsUseCase

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

@Service @Transactional public class SeedRegisteredClientsUseCase extends Object
Use case that registers the configured clients (built from DefaultClientDefinitions) that are missing. It is idempotent: a client that already exists is left untouched, including its secret.
  • Field Details

    • clientRegistrationRepository

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

      private final PasswordHasher passwordHasher
      Port that encodes secrets.
  • Constructor Details

    • SeedRegisteredClientsUseCase

      public SeedRegisteredClientsUseCase()
  • Method Details

    • execute

      public SeedResult execute(List<ClientRegistration> definitions, Map<String,String> clientSecrets)
      Registers the missing clients among the given definitions.
      Parameters:
      definitions - the clients this deployment seeds; a client that is not configured is not in the list.
      clientSecrets - clear-text secrets by client id, taken from the environment; only needed for the confidential clients that do not exist yet.
      Returns:
      the ids of the clients that were created and of those skipped; a confidential client without a secret is skipped and does not prevent the other clients from being created.