Hide Table of Contents
esri/dijit/util
esri/layer/pixelFilters
esri/process
esri/support
esri/workers
Class: Credential

require(["esri/Credential"], function(Credential) { /* code goes here */ });

Description

(Added at v2.5)
The Credential class represents a credential object used to access a secure ArcGIS resource.

Samples

Search for samples that use this class.

Properties

NameTypeSummary
expiresNumberToken expiration time specified as number of milliseconds since 1 January 1970 00:00:00 UTC.
isAdminBooleanIndicates that this credential was created to access the ArcGIS REST Admin service.
oAuthStateObjectThe Identity Manager's setOAuthRedirectionHandler returns an object that contains a "state" parameter.
serverStringThe server url.
sslBooleanIndicates whether the resources accessed using this credential should be fetched over HTTPS protocol.
tokenStringToken generated by the token service using the specified userId and password.
userIdStringUser associated wth the Credential object.

Methods

NameReturn typeSummary
destroy()NoneDestroy a credential.
refreshToken()DeferredGenerate a new token and update the Credential's token property with the newly acquired token.
toJson()ObjectReturn the properties of this object in JSON.

Events

[ On Style Events | Connect Style Event ]
All On Style event listeners receive a single event object. Additionally, the event object also contains a 'target' property whose value is the object which fired the event.

Events

NameEvent ObjectSummary
destroyFired when a credential object is destroyed.
token-changeFired when the token associated with the credential is updated or changed.
Property Details

<Number> expires

Token expiration time specified as number of milliseconds since 1 January 1970 00:00:00 UTC.

<Boolean> isAdmin

Indicates that this credential was created to access the ArcGIS REST Admin service. (Added at v3.0)
Known values: true | false

<Object> oAuthState

The Identity Manager's setOAuthRedirectionHandler returns an object that contains a "state" parameter. This parameter info is what is returned for this property. (Added at v3.10)

<String> server

The server url.

<Boolean> ssl

Indicates whether the resources accessed using this credential should be fetched over HTTPS protocol. (Added at v3.0)
Known values: true | false

<String> token

Token generated by the token service using the specified userId and password.

<String> userId

User associated wth the Credential object.
Method Details

destroy()

Destroy a credential. When the credential is destroyed remove any map layers that are using this credential. (Added at v2.8)

refreshToken()

Generate a new token and update the Credential's token property with the newly acquired token. Tokens are typically kept valid using a timer that automatically triggers a refresh before the token expires. Use this method in cases where the timer has been delayed or stopped.

Return type: Deferred

toJson()

Return the properties of this object in JSON. (Added at v2.8)
Return type: Object
Event Details
[ On Style Events | Connect Style Event ]

destroy

Fired when a credential object is destroyed. After the credential is destroyed, remove any map layers that use this credential. (Added at v3.6)

token-change

Fired when the token associated with the credential is updated or changed. (Added at v3.6)
Show Modal