Generate a token
There are situations when it is not possible to use OAuth 2.0 processes to obtain an access token. This is most common when developing command line applications, scripting with the ArcGIS API for Python, or when using the ArcGIS REST APIs. The generate
operation allows you to get an access token using your username and password.
When using this authentication method, the following best practices are recommended:
- Use HTTPS for all requests.
- Do not store or log user credentials anywhere in your application or script.
- Consider using a secure configuration for application secrets.
- Require users to enter their credentials into your application or script.
Get an access token
To get an access token, use the generate
operation and set a username
, password
, and referer
.