generate_token | R Documentation |
Generate ArcGIS Access tokens with credentials
generate_token(endpoint, username, password, expiration = 60)
endpoint |
the endpoint against which to request the token. this is generally in the format of:
|
username |
your ArcGIS online username. You should make an effort to protect this by accessing it from an environment variable so that it isn't saved in your source code or .Rhistory file. |
password |
your ArcGIS online password. You should make an effort to protect this by accessing it from an environment variable so that it isn't saved in your source code or .Rhistory file. |
expiration |
The token expiration time in minutes (defaults to 60) |
This functino enables a user to generate a token for accessing ArcGIS services where Oauth2.0 isn't possible. The documentation is here: https://developers.arcgis.com/rest/services-reference/generate-token.htm You should make an effort to protect your username in password so that it isn't saved in the source code. Some good options are here: https://cran.r-project.org/web/packages/httr/vignettes/secrets.html
You could write a wrapper function around this function which gets your credentials from an environment variable, calls the function and returns a token. getarc may provide this functionality eventually.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.