Packagecom.esri.baserver.tasks.authentication
Classpublic final class AuthenticationTask
InheritanceAuthenticationTask Inheritance AbstractTask Inheritance flash.events.EventDispatcher
Deprecated Since Community Analyst API for Flex 2.2: Please Use com.esri.bacore.tasks.ArcGISAuthenticationTask

The AuthenticationTask class is deprecated (it is replaced with the ArcGISAuthenticationTask class).

See also

ArcGISAuthenticationTask


Public Properties
 PropertyDefined By
 Inheritedconcurrency : String
Value that indicates how to handle multiple calls to the same task.
AbstractTask
 InheriteddisableClientCaching : 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
 InheritedproxyURL : String
The URL to proxy the request through.
AbstractTask
 InheritedrequestTimeout : Number
The request timeout in seconds.
AbstractTask
 InheritedshowBusyCursor : 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.
AuthenticationTask
 Inheritedurl : String
URL of the task.
AbstractTask
Public Methods
 MethodDefined By
  
AuthenticationTask(url:String)
Creates a new instance of the AuthenticationTask class.
AuthenticationTask
  
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.
AuthenticationTask
Events
 Event Summary Defined By
  The fault event is dispatched when an asynchronous execution of a Community Analyst Task fails.AuthenticationTask
  The taskCompleted event is dispatched when an asynchronous execution of a Community Analyst Task completes successfully.AuthenticationTask
Public Constants
 ConstantDefined By
  name : String = Authentication
[static] Task name.
AuthenticationTask
Property Detail
tokenproperty
token:String[override]

Authentication token received at the last execution of this task.


Implementation
    public function get token():String
    public function set token(value:String):void
Constructor Detail
AuthenticationTask()Constructor
public function AuthenticationTask(url:String)

Creates a new instance of the AuthenticationTask class.

The authentication token is requested from an ArcGIS Token Service associated with an instance of the Business Analyst Server used. 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 Business Analyst Server host name and port, respectively.

Parameters
url:String — The URL to the ArcGIS REST Token Service associated with the Business Analyst Server.
Method Detail
execute()method
public function 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.

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.

Returns
AsyncToken — Asynch token associated with the response.
Event Detail
fault Event
Event Object Type: mx.rpc.events.FaultEvent
FaultEvent.type property = mx.rpc.events.FaultEvent.FAULT

The fault event is dispatched when an asynchronous execution of a Community Analyst Task fails.

taskCompleted Event  
Event Object Type: com.esri.bacore.BATaskCompletedEvent
BATaskCompletedEvent.type property = com.esri.bacore.BATaskCompletedEvent.COMPLETE

The taskCompleted event is dispatched when an asynchronous execution of a Community Analyst Task completes successfully.

The BATaskCompletedEvent.COMPLETE constant defines the value of the type property of the event object for a taskCompleted event.

The properties of the event object have the following values:

PropertyValue
babblesfalse
cancelablefalse
currentTargetThe Object that defines the event listener that handles the event.
targetThe BATask object that dispatched the event. This is an instance of a Community Analyst Task that was executed.
taskNameName of a Community Analyst Task that was executed.
resultTask execution result object.
messagesOptional 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.

Constant Detail
nameConstant
public static const name:String = Authentication

Task name. This name only identifies the task. It is not used as an URL suffix in the getToken request.