| Package | com.esri.bacore.client |
| Interface | public interface ITokenService |
| Implementors | TokenService |
| Since : | Community Analyst API for Flex 2.2. |
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.
| Property | Defined 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 | ||
| Method | Defined 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 | ||
| token | property |
token:StringToken for accessing a secure task.
public function get token():String public function set token(value:String):void| tokenProvider | property |
tokenProvider:ITokenProviderProvider responsible for updating the security token if the last one expires.
public function get tokenProvider():ITokenProvider public function set tokenProvider(value:ITokenProvider):void| login | () | method |
public function login(username:String, password:String, responder:IResponder):voidRequests 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):BooleanUpdates 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.
|
Boolean — True if the token provider has been updated.
|