public class Authentication extends Object
Constructor and Description |
---|
Authentication() |
Authentication(Authentication clone) |
Authentication(String apiKey) |
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.
|
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.
|
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.
|
public Authentication()
public Authentication(String apiKey)
public Authentication(Authentication clone) throws HelloSignException
HelloSignException
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 © 2017 HelloSign. All rights reserved.