Example usage for org.springframework.security.oauth2.client.token.grant.implicit ImplicitResourceDetails setScope

List of usage examples for org.springframework.security.oauth2.client.token.grant.implicit ImplicitResourceDetails setScope

Introduction

In this page you can find the example usage for org.springframework.security.oauth2.client.token.grant.implicit ImplicitResourceDetails setScope.

Prototype

public void setScope(List<String> scope) 

Source Link

Usage

From source file:org.cloudfoundry.identity.uaa.integration.UaaTestAccounts.java

public ImplicitResourceDetails getImplicitResource(String clientPrefix, String defaultClientId,
        String defaultRedirectUri, String username, String password) {
    ImplicitResourceDetails resource = new ImplicitResourceDetails();
    String clientId = environment.getProperty(clientPrefix + ".id", defaultClientId);
    resource.setClientId(clientId);//  w  w w .ja v  a  2s .  c  o  m
    resource.setId(clientId);
    Map<String, String> parameters = new LinkedHashMap<String, String>();
    parameters.put("credentials",
            String.format("{\"username\":\"%s\",\"password\":\"%s\"}", username, password));
    resource.setClientAuthenticationScheme(AuthenticationScheme.header);
    resource.setAccessTokenUri(server.getAuthorizationUri());
    resource.setScope(Arrays.asList("read", "password", "openid"));
    String redirectUri = environment.getProperty(clientPrefix + ".redirect-uri", defaultRedirectUri);
    resource.setPreEstablishedRedirectUri(redirectUri);
    return resource;
}