Interface
Authentication can be supplied to request
via ArcGISIdentityManager
, ApplicationCredentialsManager
or APIKeyManager
. These classes implement Code IAuthenticationManager.
const session = new ArcGISIdentityManager({
username: "jsmith",
password: "123456",
// optional
portal: "https://[yourserver]/arcgis/sharing/rest"
})
request(url, { authentication: session })
Properties
Property | Type | Notes |
---|---|---|
boolean | Optional. Should return | |
string | Defaults to 'https://www.arcgis.com/sharing/rest'. |
portal
Interface Propertyportal: string
Defaults to 'https://www.arcgis.com/sharing/rest'.
Methods
Method | Returns | Notes |
---|---|---|
getDomainCredentials(url) | RequestCredentials | Optional. Returns the proper |
getToken(url, requestOptions?) | Promise<string> | Returns the proper token for a given URL and request options. |
refreshCredentials(requestOptions?) | Promise<IAuthenticationManager> | Optional. Refresh the stored credentials. |
getDomainCredentials
getDomainCredentials(url: string): RequestCredentials
Optional. Returns the proper credentials
option for fetch
for a given domain.
See trusted server. Used internally by underlying request methods to add support for specific security considerations.
Parameters
Parameter | Type | Notes |
---|---|---|
url | string | The url of the request |
Returns
RequestCredentials
"include" or "same-origin"
getToken
Interface MethodgetToken(url: string, requestOptions?: ITokenRequestOptions): Promise<string>
Returns the proper token for a given URL and request options.
Parameters
Parameter | Type | Notes |
---|---|---|
url | string | The requested URL. |
request | ITokenRequestOptions | the requests options. |
Returns
Promise<string>
refreshCredentials
refreshCredentials(requestOptions?: ITokenRequestOptions): Promise<IAuthenticationManager>
Optional. Refresh the stored credentials.
Parameters
Parameter | Type |
---|---|
request | ITokenRequestOptions |
Returns
Promise<IAuthenticationManager>
canRefresh: boolean
Optional. Should return
true
if these credentials can be refreshed andfalse
if it cannot.