public class Authentication extends Object
Constructor and Description |
---|
Authentication() |
Authentication(Authentication clone) |
Modifier and Type | Method and Description |
---|---|
void |
authenticate(HttpURLConnection httpConn,
String url)
Authorizes the HTTP connection using this instance's credentials.
|
String |
getAccessToken()
Returns a protected copy of the access token.
|
String |
getAccessTokenType()
Returns a protected copy of the access token type string.
|
String |
getApiKey()
Returns a protected copy of the API key String.
|
String |
getEmail()
Returns the email address for this client.
|
String |
getPassword()
Returns the password for this client.
|
boolean |
hasAccessToken()
Returns true if an access token and token type have been provided.
|
boolean |
hasApiKey()
Returns true if the API Key has been set.
|
boolean |
hasWebsiteCredentials()
Returns true if an email and password have been set.
|
void |
setAccessToken(String accessToken,
String tokenType)
Sets the access token for the HelloSign client authentication.
|
void |
setApiKey(String apiKey)
Sets the API key to use for authenticating this client.
|
void |
setWebsiteCredentials(String email,
String password)
Sets the email and password to use for authenticating the
client.
|
public Authentication()
public Authentication(Authentication clone) throws HelloSignException
HelloSignException
public void setWebsiteCredentials(String email, String password) throws HelloSignException
email
- String email addresspassword
- String passwordHelloSignException
- thrown if either the email or password
are nullpublic String getEmail()
public String getPassword()
public boolean hasWebsiteCredentials()
public String getApiKey()
public void setApiKey(String apiKey)
apiKey
- String API Keypublic boolean hasApiKey()
public String getAccessToken()
public String getAccessTokenType()
public void setAccessToken(String accessToken, String tokenType) throws HelloSignException
accessToken
- StringtokenType
- StringHelloSignException
- if either the accessToken or tokenType are nullpublic boolean hasAccessToken()
public void authenticate(HttpURLConnection httpConn, String url)
httpConn
- HttpURLConnection to be authenticatedurl
- String URL against which this connection should be authorized.Copyright © 2015 HelloSign. All rights reserved.