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

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

Introduction

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

Prototype

public void setAccessTokenConverter(AccessTokenConverter accessTokenConverter) 

Source Link

Usage

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  ww.  j a va  2  s.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;
}