Example usage for org.springframework.security.oauth2.client.token.grant.password ResourceOwnerPasswordResourceDetails setClientId

List of usage examples for org.springframework.security.oauth2.client.token.grant.password ResourceOwnerPasswordResourceDetails setClientId

Introduction

In this page you can find the example usage for org.springframework.security.oauth2.client.token.grant.password ResourceOwnerPasswordResourceDetails setClientId.

Prototype

public void setClientId(String clientId) 

Source Link

Usage

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

@Override
public ResourceOwnerPasswordResourceDetails getResourceOwnerPasswordResource(String[] scope, String clientId,
        String clientSecret, String username, String password) {

    ResourceOwnerPasswordResourceDetails resource = new ResourceOwnerPasswordResourceDetails();
    resource.setClientId(clientId);
    resource.setClientSecret(clientSecret);
    resource.setId(clientId);//from w w w.ja  v a2 s. c  o  m
    resource.setScope(Arrays.asList(scope));
    Map<String, String> parameters = new LinkedHashMap<String, String>();
    parameters.put("username", username);
    parameters.put("password", password);
    resource.setUsername(username);
    resource.setPassword(password);
    resource.setClientAuthenticationScheme(AuthenticationScheme.header);
    resource.setAccessTokenUri(server.getAccessTokenUri());
    return resource;
}

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

@Override
public ResourceOwnerPasswordResourceDetails getResourceOwnerPasswordResource(String[] scope, String clientId,
        String clientSecret, String username, String password) {

    ResourceOwnerPasswordResourceDetails resource = new ResourceOwnerPasswordResourceDetails();
    resource.setClientId(clientId);
    resource.setClientSecret(clientSecret);
    resource.setId(clientId);//w  ww  .java2 s.  c  o m
    resource.setScope(Arrays.asList(scope));
    resource.setUsername(username);
    resource.setPassword(password);
    resource.setClientAuthenticationScheme(AuthenticationScheme.header);
    resource.setAccessTokenUri(server.getAccessTokenUri());
    return resource;
}