token: Create authorization tokens

generateTokenR Documentation

Create authorization tokens

Description

Generate tokens for accessing credentialed ArcGIS REST Servers.

generateToken() can create a token from the public token endpoint https://<host>:\<port\>/\<site\>/tokens/generateToken or the admin endpoint https://\<host\>:\<port\>/\<site\>/admin/generateToken for ArcGIS REST Servers. See https://developers.arcgis.com/rest/services-reference/enterprise/generate-token.htm or https://developers.arcgis.com/rest/services-reference/enterprise/generate-admin-token.htm respectively for more information.

generateOAuthToken() can create an OAuth token for ArcGIS Online Services. See https://developers.arcgis.com/documentation/core-concepts/security-and-authentication/accessing-arcgis-online-services/ or https://developers.arcgis.com/documentation/mapping-apis-and-services/security/oauth-2.0/ for more information.

Usage

generateToken(server, uid, pwd = "", expiration = 5000)

generateOAuthToken(clientId, clientSecret, expiration = 5000)

Arguments

server

The ArcGIS REST Server you want to connect to: https://\<host\>:\<port\>

uid

The user id of the account used to create the token connection to the server

pwd

The password of the account used to create the token connection to the server. If left blank, RStudio will prompt you for the password. If you aren't using RStudio, you must specify it in the function call.

expiration

Set an expiration limit on the token in minutes. Max expiration date may be controlled by the server.

clientId

Client ID

type

Either 'tokens' or 'admin'. Specify the endpoint you use to create the token. Defaults to 'tokens'.

cliendSecret

Client Secret

Value

Character string with the token

Functions

  • generateToken: Create ArcGIS REST Service Token

  • generateOAuthToken: Create ArcGIS OAuth Token


yonghah/esri2sf documentation built on June 2, 2022, 8:18 a.m.