Learn how to create OAuth credentials to support user authentication.

OAuth credentials are an item required to implement most user authentication workflows. They contain the client
and redirect
parameters that are used to implement all OAuth 2.0 user authentication flows. The item page 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 user authentication OAuth 2.0 flows.
Prerequisites
Steps
Sign in to your portal
Create a new item
The following steps differ depending on if you have an ArcGIS Location Platform, ArcGIS Online, or an ArcGIS Enterprise account.
-
In your portal, click Content > My content > New item.
-
Click Developer credentials.
-
In the credential type screen, select OAuth 2.0 credentials and click Next.
Need troubleshooting help?
If the Developer credentials option is not visible when creating a new item, your ArcGIS Online account does not have the correct permissions. You need an ArcGIS account with a user type of Creator or higher. Learn more about user types in the ArcGIS Online documentation.
If the Select credential type menu does not display when creating developer credentials, OAuth 2.0 credentials will still be created by default. This menu only displays if your account has privileges to create multiple types of developer credentials, such as API key credentials.
Add a redirect URL
A redirect URL is a required parameter of user authentication flows. This is the URL that your application will direct users to after they successfully authenticate.
-
In the next window, find the Redirect URLs field.
-
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
or:// <server >[ :port]/callback.html" "http
. This is a valid web page or server endpoint to which a user can be redirected after successful sign in.://my-arcgis-app :/auth" - For example, if you are running an application on
https
, add://localhost :8080 https
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.://localhost :8080/callback.html
- For example, if you are running an application on
-
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.
-
Click Next.
Save the item
After configuring the redirect URL of your OAuth credentials, you can save the credentials as a new item.
-
If the Privileges window appears, click Next. These properties are not required in user authentication.
-
If the Item access window appears, click Skip. These properties are not required in user authentication.
-
In the Create developer credentials window, set the following properties:
- Title:
My O
Auth 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.
Click Next.
- Title:
-
In the Summary window, review the properties and redirect URL you have set.
-
Click Create to create your OAuth credentials.
Need troubleshooting help?
If you do not see the windows titled "Privileges" or "Item access", steps 1-2 can be safely skipped. These settings are not required for user authentication, and only appear if your ArcGIS account has the privilege titled Assign privileges to OAuth 2.0 applications.
If you are using a version of ArcGIS Enterprise prior to 11.4, the "Create developer credentials" workflow is slightly different. The steps are as follows:
-
In the Create developer credentials window, set the following properties:
- Title:
My O
Auth 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.
- Title:
-
Click Save to create your OAuth credentials.
To learn more, go to Developer credentials for ArcGIS Enterprise.
Copy the client ID and redirect URL
Your OAuth credentials contain a client
parameter that is required to implement user authentication. Copy this value, as well as your provided redirect URL, and paste them into your application.
-
On the item page of your OAuth credentials, scroll down to Credentials.
-
Copy the Client ID value and paste it into your application.
-
Click the Manage button to go to the Settings tab.
-
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
Create an application that requires users to sign in with an ArcGIS account.