org.cloudfoundry.client.lib
Class CloudCredentials

java.lang.Object
  extended by org.cloudfoundry.client.lib.CloudCredentials

public class CloudCredentials
extends Object

Class that encapsulates credentials used for authentication

Author:
Thomas Risberg

Constructor Summary
CloudCredentials(CloudCredentials cloudCredentials, String proxyForUser)
          Create proxy credentials.
CloudCredentials(org.springframework.security.oauth2.common.OAuth2AccessToken token)
          Create credentials using a token.
CloudCredentials(org.springframework.security.oauth2.common.OAuth2AccessToken token, String clientId)
          Create credentials using a token.
CloudCredentials(org.springframework.security.oauth2.common.OAuth2AccessToken token, String clientId, String clientSecret)
          Create credentials using a token.
CloudCredentials(String email, String password)
          Create credentials using email and password.
CloudCredentials(String email, String password, String clientId)
          Create credentials using email, password, and client ID.
CloudCredentials(String email, String password, String clientId, String clientSecret)
          Create credentials using email, password and client ID.
 
Method Summary
 String getClientId()
          Get the client ID.
 String getClientSecret()
          Get the client secret
 String getEmail()
          Get the email.
 String getPassword()
          Get the password.
 String getProxyUser()
          Get the proxy user.
 org.springframework.security.oauth2.common.OAuth2AccessToken getToken()
          Get the token.
 boolean isProxyUserSet()
          Is this a proxied set of credentials?
 CloudCredentials proxyForUser(String user)
          Run commands as a different user.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CloudCredentials

public CloudCredentials(String email,
                        String password)
Create credentials using email and password.

Parameters:
email - email to authenticate with
password - the password

CloudCredentials

public CloudCredentials(String email,
                        String password,
                        String clientId)
Create credentials using email, password, and client ID.

Parameters:
email - email to authenticate with
password - the password
clientId - the client ID to use for authorization

CloudCredentials

public CloudCredentials(String email,
                        String password,
                        String clientId,
                        String clientSecret)
Create credentials using email, password and client ID.

Parameters:
email - email to authenticate with
password - the password
clientId - the client ID to use for authorization
clientSecret - the secret for the given client

CloudCredentials

public CloudCredentials(org.springframework.security.oauth2.common.OAuth2AccessToken token)
Create credentials using a token.

Parameters:
token - token to use for authorization

CloudCredentials

public CloudCredentials(org.springframework.security.oauth2.common.OAuth2AccessToken token,
                        String clientId)
Create credentials using a token.

Parameters:
token - token to use for authorization
clientId - the client ID to use for authorization

CloudCredentials

public CloudCredentials(org.springframework.security.oauth2.common.OAuth2AccessToken token,
                        String clientId,
                        String clientSecret)
Create credentials using a token.

Parameters:
token - token to use for authorization
clientId - the client ID to use for authorization
clientSecret - the password for the specified client

CloudCredentials

public CloudCredentials(CloudCredentials cloudCredentials,
                        String proxyForUser)
Create proxy credentials.

Parameters:
cloudCredentials - credentials to use
proxyForUser - user to be proxied
Method Detail

getEmail

public String getEmail()
Get the email.

Returns:
the email

getPassword

public String getPassword()
Get the password.

Returns:
the password

getToken

public org.springframework.security.oauth2.common.OAuth2AccessToken getToken()
Get the token.

Returns:
the token

getClientId

public String getClientId()
Get the client ID.

Returns:
the client ID

getClientSecret

public String getClientSecret()
Get the client secret

Returns:
the client secret

getProxyUser

public String getProxyUser()
Get the proxy user.

Returns:
the proxy user

isProxyUserSet

public boolean isProxyUserSet()
Is this a proxied set of credentials?

Returns:
whether a proxy user is set

proxyForUser

public CloudCredentials proxyForUser(String user)
Run commands as a different user. The authenticated user must be privileged to run as this user.

Parameters:
user - the user to proxy for
Returns:
credentials for the proxied user


Copyright © 2013. All rights reserved.