ApplicationCredentialsManager
Class
Used to authenticate methods in ArcGIS REST JS with oAuth 2.0 application credentials. The instance of ApplicationCredentialsManager
can be passed to IRequestOptions.authentication
to authenticate requests.
Implements
Constructors
new ApplicationCredentialsManager(options: IApplicationCredentialsManagerOptions): ApplicationCredentialsManager
Parameters
Parameter | Type |
---|---|
options | IApplicationCredentialsManagerOptions |
Returns
ApplicationCredentialsManager
Properties
Property | Type | Notes |
---|---|---|
string | Defaults to 'https://www.arcgis.com/sharing/rest'. |
portal
Methods
Method | Returns | Notes |
---|---|---|
| Promise<string> | Returns the proper token for a given URL and request options. |
| Promise<ApplicationCredentialsManager> | Optional. Refresh the stored credentials. |
| Promise<string> | |
| Preferred method for creating an |
getToken
getToken(url: string, requestOptions?: ITokenRequestOptions): Promise<string>
Returns the proper token for a given URL and request options.
Parameters
Parameter | Type |
---|---|
url | string |
request | ITokenRequestOptions |
Returns
Promise<string>
refreshCredentials
refreshCredentials(): Promise<ApplicationCredentialsManager>
Optional. Refresh the stored credentials.
Returns
Promise<ApplicationCredentialsManager>
refreshToken
refreshToken(requestOptions?: ITokenRequestOptions): Promise<string>
Parameters
Parameter | Type |
---|---|
request | ITokenRequestOptions |
Returns
Promise<string>
fromCredentials static
fromCredentials(options: IApplicationCredentialsManagerOptions): ApplicationCredentialsManager
Preferred method for creating an ApplicationCredentialsManager
Parameters
Parameter | Type |
---|---|
options | IApplicationCredentialsManagerOptions |
Returns
ApplicationCredentialsManager
portal: string
Defaults to 'https://www.arcgis.com/sharing/rest'.