| Package | com.esri.bacore.client |
| Class | public class TokenService |
| Inheritance | TokenService Object |
| Implements | ITokenService |
| Subclasses | ArcGISTokenService, BAOnlineTokenService |
| Since : | Business Analyst API for Flex 2.2. |
| Property | Defined 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 | ||
| Method | Defined 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 | ||
| Method | Defined By | ||
|---|---|---|---|
createTokenProvider(username:String, password:String):ITokenProvider
Creates a new instance of token provider. | TokenService | ||
| proxyURL | property |
proxyURL:StringThe URL to proxy the request through.
public function get proxyURL():String public function set proxyURL(value:String):void| 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| url | property |
url:StringThe URL to authentication token service.
public function get url():String public function set url(value:String):void| TokenService | () | Constructor |
public function TokenService()Creates a new instance of the TokenService class.
| createTokenProvider | () | method |
protected function createTokenProvider(username:String, password:String):ITokenProviderCreates 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.
|
ITokenProvider — A new instance of token provider.
|
| login | () | method |
public function login(username:String, password:String, responder:IResponder):voidRequests 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):BooleanUpdates the tokenProvider property of this instance with the new token provider.
Parameters
username:String — User name.
| |
password:String — User password.
|
Boolean — True value.
|