Authentication is used to keep corporate and network data secure and ensure that only valid, authenticated users can access private information. Your application or its users are required to authenticate their credentials through a qualified, compatible ArcGIS product such as ArcGIS Platform, ArcGIS Online or ArcGIS Enterprise whenever attempting to:
- Access private user or organization-owned information.
- Create, edit, or publish content.
- Access location services.
You must implement an authentication method in order to grant your app's users access to secured resources. The authentication method you decide to implement may vary based on the resources required by your application. The preferred authentication methods are:
- API keys: A unique identifier to authenticate a user, developer, or calling program to an API, although most typically used to authenticate a project rather than a human user.
- ArcGIS identity (OAuth 2.0): This method authenticates user credentials through an ArcGIS product sign-on, and the platform responds with an OAuth 2.0
access_tokento the client app. The app uses this
tokenin all subsequent requests to the platform.
There are other authentication methods, typically used with ArcGIS Enterprise, that handle other application-specific use cases.
API keys allow access to location services such as basemap layers, geocoding, and routing, with a permanent key that can be restricted to specific services and client referrers and included in public-facing applications.
|Can be used to quickly write apps that consume location services.||Cannot access private content from an ArcGIS Online organization.|
|Can be used by apps that utilize sign-in or authentication systems outside of ArcGIS.|
|Provides detailed usage for all services accessed with the key.|
|Authenticate directly in your application without user credentials.|
When your app requires access to private content in the ArcGIS Platform or if you are distributing your app through ArcGIS Marketplace, you should implement OAuth 2.0 to obtain an ArcGIS identity. This allows individual users to authorize your app to use the content and services to which the user has been granted access.
During the OAuth 2.0 process, users are directed to a sign-in page on ArcGIS Online or ArcGIS Enterprise. After the user completes authentication, your app receives a token that you use in subsequent requests.
|Able to access private user content from ArcGIS Online or ArcGIS Enterprise.||End user MUST have either an ArcGIS Online or Enterprise account.|
|Location services consumption is metered to the owner of the ArcGIS identity, not the app developer.||ArcGIS identity obtained via ArcGIS Enterprise cannot access location services.|
|Tokens are temporary and can have varying expiration periods.|
|Tokens can be refreshed to extend the session.|
The choice of which type of authentication to implement is mostly dependent upon the resources required by your application. Also consider the limitations of the API or SDK technology on which your application is built.
In general we recommended that you use:
- API keys if your application needs to access location services from Esri.
- ArcGIS identity if users of your application will authenticate with their ArcGIS Online or ArcGIS Enterprise accounts.
Your choice of authentication method is also affected by the API from which you build your application. ArcGIS APIs contain a built in
AuthenticationManager which simplify obtaining and managing ArcGIS identities.
Whatever your choice of authentication, we recommend you review our security best practices when implementing both API keys and ArcGIS identity.
|API keys||ArcGIS identity|
|ArcGIS JS API|
|ArcGIS Android API|
|ArcGIS iOS API|
|ArcGIS .Net API|
|ArcGIS Qt API|
|ArcGIS Java API|
|ArcGIS Python API|
|MapBox GL JS|
|ArcGIS REST JS|