Skip to content

Learn how to create OAuth credentials with ArcGIS Enterprise to support app authentication.

The developer credentials creation interface in a portal.

The developer credentials creation interface in a portal

OAuth credentials are an item required to implement app authentication. They contain client_id and client_secret parameters that are used to implement an OAuth 2.0 client credentials flow. The item page of OAuth credentials allows you to manage settings related to app authentication, including the authorized privileges of an application.

This tutorial shows you how to create OAuth credentials for use in app authentication and do the following:

  • Configure privileges to allow your application to access ArcGIS services, content, and functionality.
  • Set authorized referrer URLs.
  • Manage settings of the OAuth credentials and monitor usage using its item page.

This tutorial focuses on creating OAuth 2.0 credentials for a private application with selected privileges and access.

Prerequisites

  1. You need an ArcGIS Enterprise account with the correct user type and role. Please review the Product and account requirements before proceeding.

  2. You need to know the privileges required by your application. The privileges assigned to developer credentials allow your application to access ArcGIS services and resources.

Steps

Sign in to your portal

You use your portal to create and manage items, including OAuth credentials.

  1. In your web browser, go to your ArcGIS Enterprise portal and sign in to your portal with your ArcGIS Enterprise account.

Create a new item

  1. In your portal, click Content > My content > New item.
    New item button

  2. Click Developer credentials.

  3. In the credential type screen, select OAuth 2.0 credentials and click Next.

    OAuth 2.0 credentials in ArcGIS Enterprise

Set referrer URLs

You can set referrer URLs on OAuth credentials that restrict the credentials to only be usable from authorized domains. This is highly recommended for security purposes.

  1. In the next window, scroll down to Referrer URLs.

  2. Set the Referrers field to the web domains you would like to restrict the access token to. To learn more about referrers, go to OAuth credentials (for app authentication).

    Referrer selector
  3. Under Application environment, select the type of environment your application will run in. This will affect when the OAuth credentials appear in portal search results.

    Application environment
  4. Click Next.

Select privileges

You can configure the settings of OAuth 2.0 credentials to configure the privileges of access tokens granted via app authentication. For an access token to work in your application, it needs to have the correct privileges to access the content and services your app is using. Select the privileges your app requires in this menu.

  1. In the Create developer credentials > Privileges window, browse the available privileges.

    Privilege selection window (ArcGIS Enterprise)
  2. Browse the table below to view the available privileges, privilege strings, and descriptions for ArcGIS Enterprise:

    CategoryLabelPrivilege stringDescription
    MembersViewportal:user:viewOrgUsersAllow application to view members of the organization.
    GroupsCreate, update, and deleteportal:user:createGroupAllow application to create, edit, and delete their own groups.
    GroupsJoin organizational groupsportal:user:joinGroupAllow application to join groups within your organization.
    GroupsView groups shared with organizationportal:user:viewOrgGroupsAllow application to view groups shared with the organization.
    GroupsAdd members from other organizationsportal:user:addExternalMembersToGroupAllow application to create groups that allow members from other organizations, as well as invite external members to groups.
    ContentGenerate API keysportal:user:generateApiTokensAllow application to generate API keys.
    ContentAssign privileges to OAuth 2.0 applicationsportal:user:assignPrivilegesToAppsAllow application to assign privileges to OAuth 2.0 applications.
    ContentCreate, update, and deleteportal:user:createItemAllow application to create, edit, and delete their own content.
    ContentPublish hosted feature layersportal:publisher:publishFeaturesAllow application to publish hosted feature layers from shapefiles, CSVs, etc.
    ContentPublish hosted tile layersportal:publisher:publishTilesAllow application to publish hosted tile layers from tile packages, features, etc.
    ContentPublish hosted scene layersportal:publisher:publishScenesAllow application to publish hosted scene layers.
    ContentPublished hosted tiled imagery layersportal:publisher:publishTiledImageryAllow application to publish hosted tiled imagery layers from a single image or collection of images. Requires an ArcGIS Image for ArcGIS Online user type extension.
    ContentPublish hosted dynamic imagery layersportal:publisher:publishDynamicImageryAllow application to publish hosted dynamic imagery layers from a single image or collection of images.
    ContentView content shared with organizationportal:user:viewOrgItemsAllow application to view content shared to the organization.
    ContentView location tracksportal:user:viewTracksAllow application to view members' location tracks via shared track views when location sharing is enabled.
    ContentReassign contentportal:user:reassignItemsAllow application to reassign ownership of content owned by the account to another member.
    ContentReceive contentportal:user:receiveItemsAllow application to receive content assigned to them by another member.
    ContentPublish livestream videoportal:publisher:publishLivestreamVideoAllow application to publish livestream videos.
    ContentPublish real-time analyticsportal:publisher:publishRealTimeAnalyticsAllow application to publish real-time analytics to analyze and process real-time data using ArcGIS Velocity.
    ContentPublish server-based layersportal:publisher:publishServerServicesAllow application to publish server-based layers.
    ContentPublish videoportal:publisher:publishVideoAllow application to publish videos.
    ContentRegister data storesportal:publisher:registerDataStoresAllow application to register video stores.
    ContentView hosted feature servicesportal:user:viewHostedFeatureServicesAllow application to view hosted feature services.
    ContentView hosted tile servicesportal:user:viewHostedTileServicesAllow application to view hosted tile services.
    ContentCategorize itemsportal:user:categorizeItemsAllow application to set the category of items you own.
    ContentManage feature layer webhooksportal:publisher:createFeatureWebhookAllow application to manage webhooks for feature layers.
    ContentBulk publish from data storesportal:publisher:bulkPublishFromDataStoresAllow application to bulk publish data from data stores.
    ContentPublish big data analyticsportal:publisher:publishBigDataAnalyticsAllow application to publish big data analytics and process historical observation data using ArcGIS Velocity.
    ContentPublish feedsportal:publisher:publishFeedsAllow application to publish feeds.
    ContentPublish knowledge graphsportal:publisher:publishKnowledgeGraphAllow application to publish knowledge graphs.
    SharingShare with groupsportal:user:shareToGroupAllow application to share content to groups.
    SharingShare with organizationportal:user:shareToOrgAllow application to share content to your organization.
    SharingShare with publicportal:user:shareToPublicAllow application to share their content publicly if permitted by the organization's public sharing policy.
    SharingMake groups visible to organizationportal:user:shareGroupToOrgAllow application to make groups discoverable by your organization.
    SharingMake groups visible to publicportal:user:shareGroupToPublicAllow application to make groups discoverable by the public.
    FeaturesEditfeatures:user:editAllow application to edit features in editable layers that are not public, based on the edit options enabled on the layer.
    FeaturesEdit with full controlfeatures:user:fullEditAllow application to add, delete, and update features in an editable, hosted feature layer, regardless of the editing options enabled on the layer.
    FeaturesManage feature layer versionsfeatures:user:manageVersionsAllow application to manage feature layer version control settings.
    Premium contentCreate notebookspremium:publisher:createNotebooksAllow application to create and edit interactive notebooks.
    Premium contentSchedule notebookspremium:publisher:scheduleNotebooksAllow application to schedule future automated runs of a notebook.
    Premium contentCreate advanced notebookspremium:publisher:createAdvancedNotebooksAllow application to import and use ArcPy modules in ArcGIS Notebooks.
    Premium contentDemographic mapspremium:user:demographicsAllow application to access demographic maps in ArcGIS Living Atlas.
    Premium contentFeature reportpremium:user:featurereportAllow application to create feature reports in ArcGIS Survey123.
    Premium contentRun web toolsportal:user:runWebToolAllow application to run web tools.
  3. Select the privileges required by your application and click Next.

Select items (optional)

If your application will require access to specific private items, you will need to configure your developer credentials to access them. The Item access menu allows you to browse your portal's content and grant your developer credentials access to specific items.

  1. If your token does not require item access, click Skip.

  2. Otherwise, in the Grant item access window, click Browse items.

    Item access button
  3. Select the items you want to grant access to. You can select up to 100 items in this menu.

    Edit item access
  4. Click Add items.

Save the item

After configuring the properties of your OAuth credentials, you can save the credentials as a new item.

  1. In the Create developer credentials window, set the following properties:

    • Title: My OAuth credentials (for app authentication)
    • Folder: Developer credentials (Create a new folder)
    • Tags: Add tags related to the privileges of the credentials.
    • Description: Describe the application that these developer credentials will be used in.
    OAuth credential details

    Click Next.

  2. In the Summary window, review the properties, privileges, and item access you have set. If you selected any privileges to access portal service operations, you must acknowledge the security implications before moving forward.

    Personal privilege agreement
  3. Click Create to create your OAuth credentials.

Copy the client ID and client secret

Your OAuth credentials contain client_id and client_secret parameters that are required to implement app authentication. Copy these values and paste them into your application or script.

  1. On the item page of your OAuth credentials, scroll down to Credentials.

  2. Copy the Client ID and Client Secret values and paste them into your application. Never expose the value of your client secret.

    Client credentials

Manage your credentials

After creating an OAuth credentials item, its privileges and item access can be managed at any time by going to the item page.

To learn more and see management steps, go to OAuth credentials (for app authentication).

Additional resources

Learn more about app authentication in the following topics:

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.