Skip to content

Latest commit

 

History

History
30 lines (20 loc) · 1.55 KB

IDENTITY.md

File metadata and controls

30 lines (20 loc) · 1.55 KB

Use OAuth 2.0 to implement ArcGIS Identity

Good news! Identity is implemented in ArcGIS Hub like the rest of ArcGIS Online using a common web standard called OAuth2.

Learn more about the benefits of ArcGIS Identity and how to start implementing ArcGIS Identity in your application.

Hub ready apps have the unique privilege of helping the public access premium ArcGIS features via a free account of their own unlocked with social media credentials.

To accomplish this, we need to point new users at the appropriate community organization when its time to sign in.

const info = new OAuthInfo({
    // ...
    portalUrl: communityPortalUrl,
    // ...
});

You can find a demonstration of how to do this on GitHub: https:/Esri/configurable-app-examples-4x-js/tree/master/hub-auth-js

When an app lives on *.arcgis.com

For apps that live on *.arcgis.com specifically, there is one more catch. The default behavior of the ArcGIS API for JavaScript when authenticating users using OAuth2 is to force redirect to https://www.arcgis.com/home/signin.html for sign in.

We'll need to override that behavior (and use a generic popup or inline redirect) and point folks straight at their own community organization.

IdentityManager.useSignInPage = false;

IdentityManager - API Reference