Add and register an app

Adding a URL reference to an existing app is an effective way to share your work with members of your organization and the public (depending on your sharing privileges). In addition to the URL, you can share other details such as the type of app, its purpose, a summary and description, and a .zip file with the code you used to create the app. Adding an app to ArcGIS Online only adds a reference to the app URL; ArcGIS Online does not store the app files.

As an app developer with an organizational account, you can also register apps with the platform. This involves registering an OAuth application so that organization members and users outside the organization can sign in to the app. See the Add and register an app using developer credentials section below for more information.

If you do not need to register your app—for example, when uploading a code sample—follow the steps in the Add an app from a URL section below.

Tip:

Another way to share apps with members of your organization and the public is to create apps with maps and gallery apps with groups.

Add an app from a URL

Follow these steps to add an item that uses a URL to access an app on the web but does not need to be registered (for example, code samples):

Note:

To add a registered app, follow the steps to add and register an app using developer credentials.

  1. Verify that you are signed in and have the privilege to create, update, and delete content.
  2. From the My content tab of the content page, click New item and click Application.
  3. Choose the type of app:
    • Web mapping—A web app built with a web API, such as JavaScript.
    • Desktop—An app for desktops built on a desktop platform, such as Java or .NET (Microsoft Windows Desktop).
    • Mobile—A downloadable app built for mobile devices with an SDK, such as iOS or Android.
    • Other application—A desktop application, Python script, or any type of generic app for which you don't have details about the application's purpose, API, SDK, or URL address.
  4. For web mapping, desktop, or mobile, type the URL of the app, for example, https://<myServer>/myWebMapApp.
  5. For desktop apps, click Browse and choose the .zip file that contains the app.
  6. Click Next.
  7. Provide a title.
  8. Choose a folder in My content where you want to save the item.

    Alternatively, you can choose Create new folder from the menu and type a folder name to save the item in a new folder.

    Folder names cannot contain 4-byte Unicode characters.

  9. If your organization has set up content categories, click Assign categories and select up to 20 categories to help people find the item.

    You can also start typing a category name to narrow the list of categories.

  10. Optionally, type tags that describe the item.

    Separate the terms with commas (for example, Federal land is considered one tag, and Federal, land is considered two tags).

    As you type, you can select any of the suggested tags that appear; suggestions are generated from tags you previously added.

  11. Optionally, add a summary that describes the app.
  12. Click Save.

Once you add the app, it appears in your content. If you need to register it later, you can do so from the Settings tab of the app's item page. See the Add and register an app using developer credentials section below for more information.

You can configure the item details, attach code if required, and share the app if you have sharing privileges.

Add and register an app using developer credentials

As a developer with an organizational account, you can add and register your app with the platform to generate an app ID. Use the app ID in the app to collect usage statistics and to allow users to sign in to the platform with OAuth 2.0, a standardized authorization framework. With OAuth 2.0, apps guide the user to sign in to the platform through a platform-hosted login page. It also allows the app to work with user content associated with their organization as well as work with other ArcGIS Online capabilities such as geocoding, routing, and GeoEnrichment. To learn more about authentication and OAuth 2.0, see Esri Developer.

Alternatively, you can embed an API key in the app when you register it.

What type of developer credentials you can include with the app depends on your privileges in the organization. If you are a member of the default administrator role or a member of a custom role with the privilege to generate API keys, you can use either an OAuth 2.0 or an API key credential in your app. Otherwise, you can use only OAuth 2.0 developer credentials in an app.

Note:

The implementation pattern for user logins differs slightly depending on whether you are developing a web-based app or a native app. Esri Developer documentation includes details and code samples for both web-based apps and native apps.

Add and register an app with embedded OAuth 2.0 credentials

When you use OAuth 2.0 credentials with the apps you create, the access token is generated dynamically when the app is accessed. The access token is valid for a maximum of 14 days.

Follow the steps below if your role does not include the privilege to create API keys.

  1. Verify that you are signed in with an organizational account that has the privilege to create, update, and delete content.
  2. Click the My content tab of the content page and click New item.
  3. In the New item window, click Developer credentials.
  4. The first window presented to you will differ depending on your privileges in the organization. If you are a member of a role that does not include the privilege to create API keys, proceed to step 5. If your role includes privileges to create API keys, proceed to step 4.
  5. Choose the OAuth 2.0 credentials option and click Next.
  6. Under Redirect URLs, provide the URL to a web page or server endpoint that will be used to redirect users after they successfully sign in. Click Add to add more redirect URLs as needed.

    The redirect URLs specified during authorization must match one of the registered URLs; otherwise, authorization will be rejected.

    A special value of urn:ietf:wg:oauth:2.0:oob can also be specified for authorization grants. This results in the authorization code being delivered to a portal URL (/oauth2/approval). This value is typically used by apps that don't have a web server or a custom URL scheme where the code can be delivered.

    The following are examples of supported redirect URL formats:

    • https://app.foo.com
    • urn:ietf:wg:oauth:2.0:oob

  7. Under Referrer URLs, provide a URL or IP address that is allowed to connect. Click Add to add more referrer URLs or IP addresses as needed.
  8. Under Application environment, choose an application environment for the app—Multiple, Native, Browser, or Server.
  9. In the URL box, type a URL for your app in the format https://<myServer>/myWebMapApp.
  10. Click Next.

    If you're a member of a role with the privilege to assign privileges to OAuth 2.0 applications, clicking Next takes you to a window where you can define what the app is allowed to do. If you do not have this privilege, proceed to step 12.

  11. Choose what actions the credentials will allow the app to perform by assigning privileges and click Next.

    The list of privileges available to you will vary depending on whether you have an ArcGIS Location Platform subscription and what privileges you have in the organization. You cannot grant privileges that your account does not possess.

    For information about types of privileges, refer to the Security and authentication guide in the Esri developer help.

  12. Click Browse items and choose which items the embedded credentials can be used to access, and click Add items.

    Alternately, you can click Skip.

  13. Provide a title.
  14. Choose a folder in My content where you want to save the item.

    Alternatively, you can choose Create new folder from the menu and type a folder name to save the item in a new folder.

    Folder names cannot contain 4-byte Unicode characters.

  15. If your organization has set up content categories, click Assign categories and select up to 20 categories to help people find the item.

    You can also start typing a category name to narrow the list of categories.

  16. Optionally, type tags that describe the item.

    Separate the terms with commas (for example, Federal land is considered one tag, and Federal, land is considered two tags).

    As you type, you can select any of the suggested tags that appear; suggestions are generated from tags you previously added.

  17. Optionally, add a summary that describes the app.
  18. Click Next.
  19. Review the credential summary. To change settings, click Back to make changes before you create the item.
  20. If you granted personal privileges for the credentials, check the box next to the security acknowledgement to confirm that you read and agree to it, and click Create to create the credentials.

The app is added to your content and its item page appears. A badge OAuth 2.0 credentials indicating that OAuth 2.0 credentials are used with the app appears on the item page and when the item is viewed from the content page or item preview panes. On the Overview tab of the item page, the badge indicates whether personal privileges are included or if only standard privileges are included in the credentials.

You can configure the item details for the app.

Click View usage on the Settings tab to access information about who has signed in to the app and the number of credits they've consumed.

Note:

The View usage section is not available when signed in through an ArcGIS Location Platform subscription.

You can also manage settings for the credentials embedded with the app.

Add and register an app with embedded API key credentials

Use API key credentials when you need to embed the credentials in the app, and you need the key to be valid for more than 14 days.

Follow the steps below to add an app and create an API key embedded with it to use for authentication purposes.

  1. Verify that you are signed in with an organizational account and has the privileges to create API keys and create, update, and delete content.
  2. Click the My content tab of the content page and click New item.
  3. In the New item window, click Developer credentials.
  4. Choose the API key credentials option and click Next.
  5. Use the calendar to specify an expiration date for the credentials.

    Credentials can expire the next day (minimum) or 365 days hence (maximum). They expire at 11:59 p.m. on the date that you choose for expiration. The time is stored based on your browser time when you add the app and generate the credentials.

  6. Under Referrer URLs, provide the URL or IP address that is allowed to connect to the app. Click Add to add more referrer URLs or IP addresses needed.

    The URLs specified during authorization must match one of the registered URLs; otherwise, authorization will be rejected.

    The following are examples of supported referrer URL formats:

    • https://www.example.com/pages
    • https://www.example.com/pages/index.html

  7. Click Next.
  8. Choose what actions the credentials will allow the app to perform by assigning privileges and click Next.

    The list of privileges available to you will vary depending on whether you have an ArcGIS Location Platform subscription and what privileges you have in the organization. You cannot grant privileges that your account does not possess.

    For information about types of privileges, refer to the Security and authentication guide in the Esri developer help.

  9. Click Browse items, choose which items the embedded credentials can be used to access, and click Add items.

    Alternately, you can click Skip.

  10. Provide a title.
  11. Choose a folder in My content where you want to save the item.

    Alternatively, you can choose Create new folder from the menu and type a folder name to save the item in a new folder.

    Folder names cannot contain 4-byte Unicode characters.

  12. If your organization has set up content categories, click Assign categories and select up to 20 categories to help people find the item.

    You can also start typing a category name to narrow the list of categories.

  13. Optionally, type tags that describe the item.

    Separate the terms with commas (for example, Federal land is considered one tag, and Federal, land is considered two tags).

    As you type, you can select any of the suggested tags that appear; suggestions are generated from tags you previously added.

  14. Optionally, add a summary that describes the app.
  15. Click Next.
  16. Review the credential summary. To change settings, click Back to make changes before you create the item.
  17. If you granted personal privileges for the credentials, check the box next to the security acknowledgement to confirm that you read and agree to it, and click Next.
  18. Choose whether to generate the API key immediately or later and click Next.

    You must copy the API key as soon as it is generated.

    • If you click the Generate the API key and go to item details page. I am ready to copy and save the key. option, the Generate API key pop-up appears when you click Next. Click the Copy button to copy the key. Paste the key in a secure document. Close the pop-up when you finish.
    • If you click the Go to item details page. I'll generate the API key later. option, the credentials item page appears. The item page appears when you click Next. You can generate the API key from the Settings tab of the item page.

The app is added to your content and its item page appears. A badge API key credentials indicating that an API key is embedded with the app appears on the item page and when the item is viewed from the content page or item preview panes. On the Overview tab of the item page, the badge indicates whether personal privileges are included or if only standard privileges are included in the credentials.

You can configure the item details for the app.

Click View usage on the Settings tab to access information about who has signed in to the app and the number of credits they've consumed.

Note:

The View usage section is not available when signed in through an ArcGIS Location Platform subscription.

You can also manage settings for the credentials embedded with the app.

Related topics