Search in sources :

Example 1 with AccountManagementSystemAuthErrorHandler

use of org.bf2.srs.fleetmanager.spi.ams.impl.exception.AccountManagementSystemAuthErrorHandler in project srs-fleet-manager by bf2fc6cc711aee1a0c2a.

the class AccountManagementServiceImpl method init.

@PostConstruct
void init() {
    log.info("Using Account Management Service with Account Management URL: {}", endpoint);
    if (ssoEnabled) {
        ApicurioHttpClient httpClient = new JdkHttpClientProvider().create(ssoTokenEndpoint, Collections.emptyMap(), null, new AccountManagementSystemAuthErrorHandler());
        final OidcAuth auth = new OidcAuth(httpClient, ssoClientId, ssoClientSecret);
        restClient = new AccountManagementSystemRestClient(endpoint, Collections.emptyMap(), auth);
    } else {
        restClient = new AccountManagementSystemRestClient(endpoint, Collections.emptyMap(), null);
    }
}
Also used : JdkHttpClientProvider(io.apicurio.rest.client.JdkHttpClientProvider) OidcAuth(io.apicurio.rest.client.auth.OidcAuth) ApicurioHttpClient(io.apicurio.rest.client.spi.ApicurioHttpClient) AccountManagementSystemAuthErrorHandler(org.bf2.srs.fleetmanager.spi.ams.impl.exception.AccountManagementSystemAuthErrorHandler) PostConstruct(javax.annotation.PostConstruct)

Aggregations

JdkHttpClientProvider (io.apicurio.rest.client.JdkHttpClientProvider)1 OidcAuth (io.apicurio.rest.client.auth.OidcAuth)1 ApicurioHttpClient (io.apicurio.rest.client.spi.ApicurioHttpClient)1 PostConstruct (javax.annotation.PostConstruct)1 AccountManagementSystemAuthErrorHandler (org.bf2.srs.fleetmanager.spi.ams.impl.exception.AccountManagementSystemAuthErrorHandler)1