IAuthenticationManager

Interface

Authentication can be supplied to request via ArcGISIdentityManager, ApplicationCredentialsManager or APIKeyManager. These classes implement Code IAuthenticationManager.

Use dark colors for code blocksCopy
        
1
2
3
4
5
6
7
8
const session = new ArcGISIdentityManager({
  username: "jsmith",
  password: "123456",
  // optional
  portal: "https://[yourserver]/arcgis/sharing/rest"
})

request(url, { authentication: session })

Properties

PropertyTypeNotes
canRefresh
 optional 
boolean

Optional. Should return true if these credentials can be refreshed and false if it cannot.

string

Defaults to 'https://www.arcgis.com/sharing/rest'.

canRefresh optional

canRefresh: boolean

Optional. Should return true if these credentials can be refreshed and false if it cannot.

portal

portal: string

Defaults to 'https://www.arcgis.com/sharing/rest'.

Methods

MethodReturnsNotes
getDomainCredentials(url)
 optional 
RequestCredentials

Optional. Returns the proper credentials option for fetch for a given domain.

getToken(url, requestOptions?)
Promise<string>

Returns the proper token for a given URL and request options.

refreshCredentials(requestOptions?)
 optional 

Optional. Refresh the stored credentials.

getDomainCredentials optional

getDomainCredentials(urlstring): 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
ParameterTypeNotes
url
string

The url of the request

Returns 
RequestCredentials

"include" or "same-origin"

getToken

getToken(urlstring, requestOptions?ITokenRequestOptions): Promise<string>

Returns the proper token for a given URL and request options.

Parameters
ParameterTypeNotes
url
string

The requested URL.

requestOptions
ITokenRequestOptions

the requests options.

Returns 
Promise<string>

refreshCredentials optional

refreshCredentials(requestOptions?ITokenRequestOptions): Promise<IAuthenticationManager>

Optional. Refresh the stored credentials.

Parameters
ParameterType
requestOptions
ITokenRequestOptions
Returns 
Promise<IAuthenticationManager>

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.