java.lang.Object
com.esri.arcgisruntime.security.Credential
com.esri.arcgisruntime.security.OAuthTokenCredential
- All Implemented Interfaces:
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
Modifier and TypeMethodDescriptioncopy()
Creates a deep copy of this OAuthTokenCredential instance.boolean
Returns the access token used to authenticate against token secured services.Returns the expiration time of the access token.long
Returns the amount of time (in seconds) from the point of creation that the access token expires.Returns the username of the user that provided credentials during the OAuth authorization workflow.int
hashCode()
Asynchronously refreshes the access token on this OAuthTokenCredential.Methods inherited from class com.esri.arcgisruntime.security.Credential
addCredentialChangedListener, fromJson, removeCredentialChangedListener, toJson
-
Method Details
-
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
Returns the username of the user that provided credentials during the OAuth authorization workflow.- Overrides:
getUsername
in classCredential
- Returns:
- the username of the OAuth user
- Since:
- 100.0.0
-
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
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
Creates a deep copy of this OAuthTokenCredential instance.- Specified by:
copy
in classCredential
- Returns:
- a deep copy of this OAuthTokenCredential instance
- Since:
- 100.1.0
-
equals
-
hashCode
public int hashCode()
-