Package | com.esri.bacore.tasks |
Class | public class ArcGISTokenProvider |
Inheritance | ArcGISTokenProvider TokenProvider Object |
This token provider can be associated with an instance of the BAQueryTask class and with a task supporting a token provider whose authentication token is requested using the ArcGIS REST token service. For example, a Business Analyst Server task can use an instance of this class as a token provider.
See also
Property | Defined By | ||
---|---|---|---|
authenticationTask : AbstractTask [override] [read-only]
Authentication task associated with this token provider. | ArcGISTokenProvider | ||
clientID : String
Client ID used for getting a long-lived token. | ArcGISTokenProvider | ||
currentToken : String
Current authentication token. | TokenProvider | ||
proxyURL : String
The URL to proxy the request through. | TokenProvider | ||
timeout : int
An expiration timeout in minutes used when a long-lived token is requested. | ArcGISTokenProvider | ||
url : String
Authentication service URL. | TokenProvider |
Method | Defined By | ||
---|---|---|---|
ArcGISTokenProvider(authentication:IAuthentication, url:String = null)
Creates a new instance of the ArcGISTokenProvider class. | ArcGISTokenProvider | ||
updateToken(responder:IResponder):void
Requests an authentication service for getting a new security token. | TokenProvider |
authenticationTask | property |
authenticationTask:AbstractTask
[read-only] [override] Authentication task associated with this token provider.
public function get authenticationTask():AbstractTask
clientID | property |
clientID:String
Client ID used for getting a long-lived token.
The Client ID is either an IP address of the client computer or the 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.
The default value is ""
.
public function get clientID():String
public function set clientID(value:String):void
timeout | property |
timeout:int
An expiration timeout in minutes used when a long-lived token is requested. Zero value means the default timeout.
The default value is 0
.
public function get timeout():int
public function set timeout(value:int):void
ArcGISTokenProvider | () | Constructor |
public function ArcGISTokenProvider(authentication:IAuthentication, url:String = null)
Creates a new instance of the ArcGISTokenProvider class.
The authentication
object receives in the getUserCredentials
request
a userInfo
object with the "url" property specifying the token service URL,
the "clientID" property specifying the client ID string, and the "timeout" property
specifying the expiration timeout. These properties should be passed to the output
userCredentials
object along with the "username" and "password" properties.
authentication:IAuthentication — An object used for getting user credentials.
| |
url:String (default = null ) — The URL to the ArcGIS REST Token Service associated with the Business Analyst Server.
|
The code snippet below shows how to create an instance of the token provider. Different tasks can share the same token provider object.
To get the example working, specify valid values for username, password and the URLs.
ver tokenProvider : ArcGISTokenProvider = new ArcGISTokenProvider(new UserCredentials("username", "password")); tokenProvider.Url = "https://localhost/ArcGIS/tokens"; var task:BAQueryTask = new BAQueryTask(); task.TokenProvider = tokenProvider;