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

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

Introduction

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

Prototype

public void setUsername(String username) 

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);//w ww  . ja  v a2  s.c  o m
    resource.setClientSecret(clientSecret);
    resource.setId(clientId);
    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);/* w w w .jav  a 2  s .  c  om*/
    resource.setClientSecret(clientSecret);
    resource.setId(clientId);
    resource.setScope(Arrays.asList(scope));
    resource.setUsername(username);
    resource.setPassword(password);
    resource.setClientAuthenticationScheme(AuthenticationScheme.header);
    resource.setAccessTokenUri(server.getAccessTokenUri());
    return resource;
}