Tutorial: Create OAuth credentials for user authentication

Learn how to create to support .

The developer credentials creation interface in a portal.
The developer credentials creation interface in a portal

are an required to implement most workflows. They contain the client_id and redirect_url parameters that are used to implement all user authentication flows. The of OAuth credentials allows you to manage settings related to app authentication, including the allowed redirect URLs of an application.

This tutorial shows you how to create OAuth credentials for use in OAuth 2.0 flows.

Prerequisites

Steps

Sign in to your portal

You use your to create and manage , including .

  1. Access your portal by navigating to or the URL of your portal instance.

  2. Sign in with your .

Create a new item

The following steps differ depending on if you have an , , or an account:

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

    New item button
  2. Click > and click Next.

    OAuth credentials

Add a redirect URL

A redirect URL is a required parameter of flows. This is the URL that your application will direct users to after they successfully authenticate.

  1. In the next window, find the Redirect URLs field.

  2. Under Redirect URLs, add the URL that you want to direct users to after completing authentication. This URL varies based on your application and typically takes the format of "https://<server>[:port]/callback.html" or "http://my-arcgis-app:/auth". This is a valid web page or server endpoint to which a user can be redirected after successful sign in.

    • For example, if you are running an application on https://localhost:8080, add https://localhost:8080/callback.html to the list of redirect URLs. The exact URL depends on the name of your callback page and the programming language you are using. If you are following a "Sign in with user authentication" ArcGIS tutorial, it will specify the name of your callback page.
    Redirect URL
  3. Under Application environment, select the type of environment your application will run in. This will affect when the OAuth credentials appear in search results.

    Application environment
  4. Click Next.

Save the item

After configuring the redirect URL of your OAuth credentials, you can save the credentials as a new .

  1. In the Privileges window, click Next. These properties are not required in .

  2. In the Item access window, click Skip. These properties are not required in .

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

    • Title: My OAuth credentials (for user authentication)
    • Folder: Developer credentials (Create a new folder)
    • Tags: User authentication
    • Description: Describe the application that these developer credentials will be used in.
    OAuth credential details

    Click Next.

  4. In the Summary window, review the properties and redirect URL you have set.

  5. Click Create to create your .

Copy the client ID and redirect URL

Your contain a client_id parameter that is required to implement . Copy this value, as well as your provided redirect URL, and paste them into your application.

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

  2. Copy the Client ID value and paste it into your application.

    Client credentials
  3. Click the Manage button to go to the Settings tab.

    Manage credentials button
  4. Under Redirect URLs, copy the redirect URL you provided earlier. Paste it into your application.

What's next?

Learn how to implement user authentication with ArcGIS APIs and SDKs:

Sign in with user authentication

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

You can no longer sign into this site. Go to your ArcGIS portal or the ArcGIS Location Platform dashboard to perform management tasks.

Your ArcGIS portal

Create, manage, and access API keys and OAuth 2.0 developer credentials, hosted layers, and data services.

Your ArcGIS Location Platform dashboard

Manage billing, monitor service usage, and access additional resources.

Learn more about these changes in the What's new in Esri Developers June 2024 blog post.

Close