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_token to the client app. The app uses this token in 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

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.
Learn more about API keys

ArcGIS identity

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.
Learn more about ArcGIS identity

Choosing an authentication method

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:

Your choice of authentication method is also affected by the API from which you build your application. ArcGIS APIs contain a built in IdentityManger or 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 keysArcGIS identity
ArcGIS JS APIFully supportedFully supported
ArcGIS Android APIFully supportedFully supported
ArcGIS iOS APIFully supportedFully supported
ArcGIS .Net APIFully supportedFully supported
ArcGIS Qt APIFully supportedFully supported
ArcGIS Java APIFully supportedFully supported
ArcGIS Python APIFully supportedFully supported
Esri LeafletFully supportedSupports using a token obtained from OAuth 2.0 but lacks advanced identity management features.
MapBox GL JSFully supportedSupports using a token obtained from OAuth 2.0 but lacks advanced identity management features.
OpenLayersFully supportedSupports using a token obtained from OAuth 2.0 but lacks advanced identity management features.
ArcGIS REST JSFully supportedFully supported
Full supportPartial support (see notes)Not supported