How to authenticate with ArcGIS Portal using Esri Identity Manager

The Esri Identity manager provides a very handy way to authenticate an ArcGIS Server JavaScript API application with ArcGIS Portal, but the instructions are a little vague. Here is a step-by-step guide to using Esri IdentityManager:

In the Content section of ArcGIS Portal, Add a new Application:

add new application

Enter the URL for the application (it must be HTTPS) and add a title and tags:

add new application

Go to the Settings page for the new application, and scroll down to the App Registration section. Use the Register button:

add new application

Enter the URL(s) for any pages/sites which will be using this application, then hit Add to add to the list. Hit Register when finished:

add new application

This will generate a unique AppID for this application:

add new application

Use that AppID in the demo at https://jsfiddle.net/slead/wb8e3mh9/, which uses the ArcGIS Portal to authenticate the user, before attempting to query a secure layer. This query step is a quick way to force the login prompt to appear.

Update the placeholder variables with the relevant values:

var appId = 'enter-the-app-id'
var portalUrl = 'enter-the-portal-url';
var testUrl = 'enter-the-full-path-to-the-secure-layer'

add new application

Back to articles

CONTACT