Example usage for org.springframework.boot.autoconfigure.security.oauth2.resource UserInfoTokenServices setRestTemplate

List of usage examples for org.springframework.boot.autoconfigure.security.oauth2.resource UserInfoTokenServices setRestTemplate

Introduction

In this page you can find the example usage for org.springframework.boot.autoconfigure.security.oauth2.resource UserInfoTokenServices setRestTemplate.

Prototype

public void setRestTemplate(OAuth2RestOperations restTemplate) 

Source Link

Usage

From source file:com.orange.clara.tool.config.UserInfoTokenServicesConfiguration.java

@Bean
public UserInfoTokenServices userInfoTokenServices() {
    UserInfoTokenServices services = new SsoUserDetailsService(this.sso.getUserInfoUri(),
            this.sso.getClientId());
    services.setRestTemplate(this.restTemplate);
    services.setTokenType(this.sso.getTokenType());
    return services;
}

From source file:de.dominikschadow.duke.encounters.config.WebSecurityConfig.java

private Filter ssoFilter(ClientResources client, String path) {
    OAuth2ClientAuthenticationProcessingFilter oAuth2ClientAuthenticationFilter = new OAuth2ClientAuthenticationProcessingFilter(
            path);/*from  w ww . ja  v a2s . co m*/
    OAuth2RestTemplate oAuth2RestTemplate = new OAuth2RestTemplate(client.getClient(), oauth2ClientContext);
    oAuth2ClientAuthenticationFilter.setRestTemplate(oAuth2RestTemplate);
    UserInfoTokenServices tokenServices = new UserInfoTokenServices(client.getResource().getUserInfoUri(),
            client.getClient().getClientId());
    tokenServices.setRestTemplate(oAuth2RestTemplate);
    oAuth2ClientAuthenticationFilter.setTokenServices(tokenServices);
    return oAuth2ClientAuthenticationFilter;
}

From source file:org.springframework.cloud.dataflow.server.config.security.OAuthSecurityConfiguration.java

@Bean
public UserInfoTokenServices tokenServices() {
    final UserInfoTokenServices tokenServices = new UserInfoTokenServices(
            resourceServerProperties.getUserInfoUri(), authorizationCodeResourceDetails.getClientId());
    tokenServices.setRestTemplate(oAuth2RestTemplate());
    return tokenServices;

}