| Package | com.esri.bacore.tasks | 
| Class | public final class ArcGISAuthenticationTask | 
| Inheritance | ArcGISAuthenticationTask    AbstractTask   flash.events.EventDispatcher | 
token property of ArcGIS Server tasks.
	 
	 | Property | Defined By | ||
|---|---|---|---|
![]()  | concurrency : String 
		 Value that indicates how to handle multiple calls to the same task.  | AbstractTask | |
![]()  | disableClientCaching : Boolean 
		 If true, adds a timestamp parameter ("_ts") to the REST request to prevent the request from
		 being loaded from the browser's cache.  | AbstractTask | |
![]()  | proxyURL : String 
		 The URL to proxy the request through.  | AbstractTask | |
![]()  | requestTimeout : Number 
		 The request timeout in seconds.  | AbstractTask | |
![]()  | showBusyCursor : Boolean 
		 If true, a busy cursor is displayed while a service is executing.  | AbstractTask | |
| token : String [override] 
		 Authentication token received at the last execution of this task.  | ArcGISAuthenticationTask | ||
![]()  | url : String 
		 URL of the task.  | AbstractTask | |
| Method | Defined By | ||
|---|---|---|---|
ArcGISAuthenticationTask(url:String) 
		 Creates a new instance of the ArcGISAuthenticationTask class.  | ArcGISAuthenticationTask | ||
execute(username:String, password:String, clientID:String = null, timeout:int = 0, responder:IResponder = null):AsyncToken 
		 Sends a request to the authentication service for getting an authentication token.  | ArcGISAuthenticationTask | ||
| Event | Summary | Defined By | ||
|---|---|---|---|---|
| The fault event is dispatched when an asynchronous execution of a Community Analyst Task fails. | ArcGISAuthenticationTask | |||
| The taskCompleted event is dispatched when an asynchronous execution of a Community Analyst Task completes successfully. | ArcGISAuthenticationTask | |||
| Constant | Defined By | ||
|---|---|---|---|
| name : String = ArcGISAuthentication [static] 
		 Task name.  | ArcGISAuthenticationTask | ||
| token | property | 
token:String[override] Authentication token received at the last execution of this task.
    public function get token():String    public function set token(value:String):void| ArcGISAuthenticationTask | () | Constructor | 
public function ArcGISAuthenticationTask(url:String)Creates a new instance of the ArcGISAuthenticationTask class.
The authentication token is requested from an ArcGIS REST Token Service. The base URL to this service looks as follows:
https://{host}:{port}/ArcGIS/tokens
The {host} and {port} parameters in this URL should be substituted with
		 valid ArcGIS Server host name and port, respectively.
url:String — The URL to the ArcGIS REST Token Service. 
		  | 
| execute | () | method | 
 public function execute(username:String, password:String, clientID:String = null, timeout:int = 0, responder:IResponder = null):AsyncTokenSends a request to the authentication service for getting an authentication token.
If the clientID parameter is null or empty, a short-lived token is requested.
		 Otherwise, a long-lived token is requested and the timeout parameter specifies
		 how long this token should be valid. If timeout is zero, the default
		 expiration timeout is requested.
The Client ID is either IP address of client computer or 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.
A response can be received in two ways—in an optional
		 responder object passed in parameters
		 of this method and/or in listeners of fault and taskCompleted
		 events registered for this task.
The responder is notified first when a response is received and parsed.
		 Its fault method receives a parameter of the FaultEvent type and its
		 result method receives a parameter of the BATaskCompletedEvent type
		 whose result property contains the authentication token received.
		 After that the received event is dispatched to listeners of this task.
If response is succesfully received and parsed, a new authentication token is saved in
		 the token property of this task.
Parameters
username:String — Valid ESRI user name.
		  | |
password:String — User password.
		  | |
clientID:String (default = null) — Cliend ID used for requesting a long-lived token.
		  | |
timeout:int (default = 0) — An expiration timeout in minutes used when a long-lived token is requested.
		 Zero value means the default timeout.
		  | |
responder:IResponder (default = null) — A responder to call on result or fault.
		  | 
AsyncToken — Asynch token associated with the response.
		  | 
| fault | Event | 
mx.rpc.events.FaultEventmx.rpc.events.FaultEvent.FAULTThe fault event is dispatched when an asynchronous execution of a Community Analyst Task fails.
| taskCompleted | Event | 
com.esri.bacore.BATaskCompletedEventcom.esri.bacore.BATaskCompletedEvent.COMPLETEThe taskCompleted event is dispatched when an asynchronous execution of a Community Analyst Task completes successfully.
The BATaskCompletedEvent.COMPLETE constant defines the value of thetype property of the event object for a taskCompleted event.
		 
		 The properties of the event object have the following values:
| Property | Value | 
|---|---|
babbles | false | 
cancelable | false | 
currentTarget | The Object that defines the event listener that handles the event. | 
target | The BATask object that dispatched the event. This is an instance of a Community Analyst Task that was executed. | 
taskName | Name of a Community Analyst Task that was executed. | 
result | Task execution result object. | 
messages | Optional array of TaskMessage objects received. | 
The currentTarget and target properties are
		 specified after the event was dispatched. A responder object passed in parameters of
		 a Community Analyst Task execute method receives the event before it is dispatched.
| name | Constant | 
public static const name:String = ArcGISAuthenticationTask name. This name only identifies the task. It is not used as an URL suffix in the getToken request.
     
     task.execute(username, password, new Responder(onResult, onFault));