generateToken | R Documentation |
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.
generateToken(server, uid, pwd = "", expiration = 5000) generateOAuthToken(clientId, clientSecret, expiration = 5000)
server |
The ArcGIS REST Server you want to connect to: |
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 |
Character string with the token
generateToken
: Create ArcGIS REST Service Token
generateOAuthToken
: Create ArcGIS OAuth Token
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.