Packagecom.esri.bacore.client
Classpublic class TokenService
InheritanceTokenService Inheritance Object
Implements ITokenService
Subclasses ArcGISTokenService, BAOnlineTokenService

Since : Community Analyst API for Flex 2.2.

The TokenService is the base abstract class for token-based authentication service.



Public Properties
 PropertyDefined By
  proxyURL : String
The URL to proxy the request through.
TokenService
  token : String
Token for accessing a secure task.
TokenService
  tokenProvider : ITokenProvider
Provider responsible for updating the security token if the last one expires.
TokenService
  url : String
The URL to authentication token service.
TokenService
Public Methods
 MethodDefined By
  
Creates a new instance of the TokenService class.
TokenService
  
login(username:String, password:String, responder:IResponder):void
Requests a token service for getting a security token and creates a token provider.
TokenService
  
updateTokenProvider(username:String, password:String):Boolean
Updates the tokenProvider property of this instance with the new token provider.
TokenService
Protected Methods
 MethodDefined By
  
createTokenProvider(username:String, password:String):ITokenProvider
Creates a new instance of token provider.
TokenService
Property Detail
proxyURLproperty
proxyURL:String

The URL to proxy the request through.


Implementation
    public function get proxyURL():String
    public function set proxyURL(value:String):void
tokenproperty 
token:String

Token for accessing a secure task.


Implementation
    public function get token():String
    public function set token(value:String):void
tokenProviderproperty 
tokenProvider:ITokenProvider

Provider responsible for updating the security token if the last one expires.


Implementation
    public function get tokenProvider():ITokenProvider
    public function set tokenProvider(value:ITokenProvider):void
urlproperty 
url:String

The URL to authentication token service.


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

Creates a new instance of the TokenService class.

Method Detail
createTokenProvider()method
protected function createTokenProvider(username:String, password:String):ITokenProvider

Creates a new instance of token provider. This method is abstract and it should be implemented in derived classes.

Parameters

username:String — User name.
 
password:String — User password.

Returns
ITokenProvider — A new instance of token provider.
login()method 
public function login(username:String, password:String, responder:IResponder):void

Requests a token service for getting a security token and creates a token provider.

The algorithm of executing this method is the following: If the token service fails to get a new token, the responder.fault method is called with an instance of the mx.rpc.events.FaultEvent type. If the token service returns a new security token, the tokenProvider and token properties of this instance are updated and after that the responder.result method is called with the new token passed in the parameter.

Parameters

username:String — User name.
 
password:String — User password.
 
responder:IResponder — Responder object to be notified on a response from the token service.

updateTokenProvider()method 
public function updateTokenProvider(username:String, password:String):Boolean

Updates the tokenProvider property of this instance with the new token provider.

Parameters

username:String — User name.
 
password:String — User password.

Returns
Boolean — True value.