Example usage for org.springframework.security.oauth2.provider.token RemoteTokenServices setClientId

List of usage examples for org.springframework.security.oauth2.provider.token RemoteTokenServices setClientId

Introduction

In this page you can find the example usage for org.springframework.security.oauth2.provider.token RemoteTokenServices setClientId.

Prototype

public void setClientId(String clientId) 

Source Link

Usage

From source file:st.malike.auth.client.security.SecurityConfig.java

@Bean
public ResourceServerTokenServices tokenService() {
    RemoteTokenServices tokenServices = new RemoteTokenServices();
    tokenServices.setClientId(appId);
    tokenServices.setClientSecret(appSecret);
    tokenServices//from w  w w  .  j a v  a2  s  . c  o  m
            .setCheckTokenEndpointUrl("http://" + authServerHost + ":" + authServerPort + "/oauth/check_token");
    return tokenServices;
}

From source file:io.gravitee.management.security.config.oauth2.OAuth2SecurityConfigurerAdapter.java

@Bean
public RemoteTokenServices remoteTokenServices() {
    RemoteTokenServices s = new RemoteTokenServices();
    s.setCheckTokenEndpointUrl(oauthEndpointCheckToken);
    s.setClientId(oauthClientId);
    s.setClientSecret(oauthClientSecret);
    return s;//w w w.  jav  a2s  .  co m
}

From source file:org.openlmis.fulfillment.security.ResourceServerSecurityConfiguration.java

/**
 * RemoteTokenServices bean initializer.
 * @param checkTokenUrl url to check tokens against
 * @param clientId client's id//from w  w w.j a v  a  2s  .co m
 * @param clientSecret client's secret
 * @return token services
 */
@Bean
@Autowired
public RemoteTokenServices remoteTokenServices(@Value("${auth.server.url}") String checkTokenUrl,
        @Value("${auth.server.clientId}") String clientId,
        @Value("${auth.server.clientSecret}") String clientSecret) {
    final RemoteTokenServices remoteTokenServices = new RemoteTokenServices();
    remoteTokenServices.setCheckTokenEndpointUrl(checkTokenUrl);
    remoteTokenServices.setClientId(clientId);
    remoteTokenServices.setClientSecret(clientSecret);
    remoteTokenServices.setAccessTokenConverter(accessTokenConverter());
    return remoteTokenServices;
}