Class ClientSeeder
java.lang.Object
com.irurueta.authserver.authorization.api.web.clients.ClientSeeder
- All Implemented Interfaces:
org.springframework.boot.ApplicationRunner
@Component
@EnableConfigurationProperties(ClientSeedProperties.class)
public class ClientSeeder
extends Object
implements org.springframework.boot.ApplicationRunner
Seeds the configured default clients at startup. The run is idempotent: clients that already exist are left
alone. Only the clients whose redirect URIs are configured in
ClientSeedProperties are seeded, so a
deployment never gets a client (or a localhost redirect URI) it did not ask for. The secret of the
confidential bff client comes from the environment; when it is not configured, the confidential client is
skipped with a warning instead of being created with a weak secret.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final StringAudience of the authorization server's own API, given to the seeded clients.private final ClientSeedPropertiesSeed configuration.private final SeedRegisteredClientsUseCaseSeeds the clients. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidrun(org.springframework.boot.ApplicationArguments args) Seeds the configured default clients that do not exist yet.
-
Field Details
-
seedRegisteredClientsUseCase
Seeds the clients. -
properties
Seed configuration. -
apiAudience
Audience of the authorization server's own API, given to the seeded clients.
-
-
Constructor Details
-
ClientSeeder
public ClientSeeder()
-
-
Method Details
-
run
public void run(org.springframework.boot.ApplicationArguments args) Seeds the configured default clients that do not exist yet.- Specified by:
runin interfaceorg.springframework.boot.ApplicationRunner- Parameters:
args- the application arguments.
-