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

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

Introduction

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

Prototype

public void setClientSecret(String clientSecret) 

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 w  w  .j  a 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  . j  a v a2  s  . c o  m*/
    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;
}