Example usage for org.springframework.security.oauth2.client.resource OAuth2ProtectedResourceDetails getId

List of usage examples for org.springframework.security.oauth2.client.resource OAuth2ProtectedResourceDetails getId

Introduction

In this page you can find the example usage for org.springframework.security.oauth2.client.resource OAuth2ProtectedResourceDetails getId.

Prototype

public String getId();

Source Link

Document

Get a unique identifier for these protected resource details.

Usage

From source file:cz.cvut.zuul.support.spring.client.OAuth2ResourceDetailsBuilder.java

/**
 * @return Configured {@code OAuth2RestTemplate} instance for this resource.
 *//*w ww.j  a v a 2 s  . co m*/
public OAuth2RestTemplate build() {
    OAuth2ProtectedResourceDetails resource = getResourceDetails();

    OAuth2ClientContext context = resource.isClientOnly() ? new DefaultOAuth2ClientContext()
            : new ScopedOAuth2ClientContext(resource.getId());

    return new OAuth2RestTemplate(resource, context);
}