Package com.esri.arcgisruntime.security
Class OAuthTokenCredential
- java.lang.Object
-
- com.esri.arcgisruntime.security.Credential
-
- com.esri.arcgisruntime.security.OAuthTokenCredential
-
- All Implemented Interfaces:
TokenCredential
public final class OAuthTokenCredential extends Credential implements TokenCredential
Encapsulates a credential created from the OAuth workflow. Allows access to the token, and to be passed to various objects to provide authentication against token secured resources.- Since:
- 100.0.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.esri.arcgisruntime.security.Credential
Credential.CredentialChangedEvent, Credential.CredentialChangedListener
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OAuthTokenCredentialcopy()Creates a deep copy of this OAuthTokenCredential instance.booleanequals(java.lang.Object o)java.lang.StringgetAccessToken()Returns the access token used to authenticate against token secured services.java.util.CalendargetExpiration()Returns the expiration time of the access token.longgetExpiresIn()Returns the amount of time (in seconds) from the point of creation that the access token expires.java.lang.StringgetUsername()Returns the username of the user that provided credentials during the OAuth authorization workflow.inthashCode()ListenableFuture<java.lang.String>refreshTokenAsync()Asynchronously refreshes the access token on this OAuthTokenCredential.-
Methods inherited from class com.esri.arcgisruntime.security.Credential
addCredentialChangedListener, fromJson, removeCredentialChangedListener, toJson
-
-
-
-
Method Detail
-
getAccessToken
public java.lang.String getAccessToken()
Returns the access token used to authenticate against token secured services.- Returns:
- the access token
- Since:
- 100.0.0
-
getExpiresIn
public long getExpiresIn()
Returns the amount of time (in seconds) from the point of creation that the access token expires.- Returns:
- the time from creation in which the access token will expire
- Since:
- 100.0.0
-
getUsername
public java.lang.String getUsername()
Returns the username of the user that provided credentials during the OAuth authorization workflow.- Overrides:
getUsernamein classCredential- Returns:
- the username of the OAuth user
- Since:
- 100.0.0
-
getExpiration
public java.util.Calendar getExpiration()
Returns the expiration time of the access token. This is simply the timestamp at the creation of the credential plus the returned "expiresIn".- Returns:
- the expiration time of this credential's access token
- Since:
- 100.0.0
-
refreshTokenAsync
public ListenableFuture<java.lang.String> refreshTokenAsync()
Asynchronously refreshes the access token on this OAuthTokenCredential.- Returns:
- a ListenableFuture for tracking when the computation is done and getting the resulting new access token
- Since:
- 100.0.0
-
copy
public OAuthTokenCredential copy()
Creates a deep copy of this OAuthTokenCredential instance.- Specified by:
copyin classCredential- Returns:
- a deep copy of this OAuthTokenCredential instance
- Since:
- 100.1.0
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-