Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
54 lines (38 sloc) 1.7 KB

Client configuration

Client configuration represented at this file.

Injecting client properties:

private final ClientProperties clientProperties;

@Autowired
public ClientConfiguration(ClientProperties clientProperties) {
    this.clientProperties = clientProperties;
}

Current iVIS client:

@Bean(name = "clientInformation")
public AuthorizationCodeResourceDetails ivisClient() {
    IvisAuthorizationCodeResourceDetails client = new IvisAuthorizationCodeResourceDetails();
    String userAuthorizationUrl = clientProperties.getApiServerAddress() + clientProperties.getUserAuthorizationRelativeUri();
    String accessTokenUrl = clientProperties.getApiServerAddress() + clientProperties.getAccessTokenRelativeUri();

    client.setClientId(clientProperties.getClientId());
    client.setClientSecret(clientProperties.getClientSecret());
    client.setUserAuthorizationUri(userAuthorizationUrl);
    client.setAccessTokenUri(accessTokenUrl);

    return client;
}

Client context for service invocation:

@Bean
public OAuth2ClientContext clientContext() {
    return new DefaultOAuth2ClientContext();
}

Service factory for creating service classes:

@Bean
public ProxyIvisServiceFactory ivisServiceFactory() {
    String apiUrl = clientProperties.getApiServerAddress() + clientProperties.getApiRelativeUri();
    return new ProxyIvisServiceFactory(apiUrl, clientContext(), ivisClient());
}
You can’t perform that action at this time.