Packagecom.esri.bacore.client
Interfacepublic interface ITokenService
Implementors TokenService

Since : Community Analyst API for Flex 2.2.

The ITokenService interface provides a token-based authentication service.

An instance of the token service can be activated with or without login. You can create a token provider with the updateTokenProvider method. In this case, when a task using this token provider receives an authentication error, it calls the token provider and logs in. You can also create a token provider with the login method. In this case, the token service at first tries to log in and after that updates the token provider on success.



Public Properties
 PropertyDefined By
  token : String
Token for accessing a secure task.
ITokenService
  tokenProvider : ITokenProvider
Provider responsible for updating the security token if the last one expires.
ITokenService
Public Methods
 MethodDefined By
  
login(username:String, password:String, responder:IResponder):void
Requests a token service for getting a security token and (optionally) creates a token provider.
ITokenService
  
updateTokenProvider(username:String, password:String):Boolean
Updates the tokenProvider property of this instance with the new token provider.
ITokenService
Property Detail
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
Method Detail
login()method
public function login(username:String, password:String, responder:IResponder):void

Requests a token service for getting a security token and (optionally) creates a token provider.

The contract on executing this method is the following: If the token service fails to get a new token, the responder.fault method must be 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 should be updated and after that the responder.result method must be 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.

If an implementation of the token service doesn't support token providers, this method should return false.

Parameters

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

Returns
Boolean — True if the token provider has been updated.