Packagecom.esri.bacore.tasks
Classpublic class ArcGISTokenProvider
InheritanceArcGISTokenProvider Inheritance TokenProvider Inheritance Object

The ArcGISTokenProvider class implements the token provider based on ArcGIS REST token service.

This token provider can be associated with an instance of the BAQueryTask class and with a task supporting a token provider whose authentication token is requested using the ArcGIS REST token service. For example, a Business Analyst Server task can use an instance of this class as a token provider.

View the examples

See also

BAQueryTask


Public Properties
 PropertyDefined By
  authenticationTask : AbstractTask
[override] [read-only] Authentication task associated with this token provider.
ArcGISTokenProvider
  clientID : String
Client ID used for getting a long-lived token.
ArcGISTokenProvider
 InheritedcurrentToken : String
Current authentication token.
TokenProvider
 InheritedproxyURL : String
The URL to proxy the request through.
TokenProvider
  timeout : int
An expiration timeout in minutes used when a long-lived token is requested.
ArcGISTokenProvider
 Inheritedurl : String
Authentication service URL.
TokenProvider
Public Methods
 MethodDefined By
  
ArcGISTokenProvider(authentication:IAuthentication, url:String = null)
Creates a new instance of the ArcGISTokenProvider class.
ArcGISTokenProvider
 Inherited
updateToken(responder:IResponder):void
Requests an authentication service for getting a new security token.
TokenProvider
Property Detail
authenticationTaskproperty
authenticationTask:AbstractTask  [read-only] [override]

Authentication task associated with this token provider.


Implementation
    public function get authenticationTask():AbstractTask
clientIDproperty 
clientID:String

Client ID used for getting a long-lived token.

The Client ID is either an IP address of the client computer or the URL of the web application that the client browser is using. The valid Client ID value should start from the "ip." string for the IP-address case and from the "ref." string for the Web Referrer URL case.

The default value is "".


Implementation
    public function get clientID():String
    public function set clientID(value:String):void
timeoutproperty 
timeout:int

An expiration timeout in minutes used when a long-lived token is requested. Zero value means the default timeout.

The default value is 0.


Implementation
    public function get timeout():int
    public function set timeout(value:int):void
Constructor Detail
ArcGISTokenProvider()Constructor
public function ArcGISTokenProvider(authentication:IAuthentication, url:String = null)

Creates a new instance of the ArcGISTokenProvider class.

The authentication object receives in the getUserCredentials request a userInfo object with the "url" property specifying the token service URL, the "clientID" property specifying the client ID string, and the "timeout" property specifying the expiration timeout. These properties should be passed to the output userCredentials object along with the "username" and "password" properties.

Parameters
authentication:IAuthentication — An object used for getting user credentials.
 
url:String (default = null) — The URL to the ArcGIS REST Token Service associated with the Business Analyst Server.
Examples

The code snippet below shows how to create an instance of the token provider. Different tasks can share the same token provider object.

To get the example working, specify valid values for username, password and the URLs.

     ver tokenProvider : ArcGISTokenProvider = new ArcGISTokenProvider(new UserCredentials("username", "password"));
     tokenProvider.Url = "https://localhost/ArcGIS/tokens";
     
     var task:BAQueryTask = new BAQueryTask();
     task.TokenProvider = tokenProvider;