import identityManager from "@arcgis/core/identity/IdentityManager.js";const identityManager = await $arcgis.import("@arcgis/core/identity/IdentityManager.js");- Since
- ArcGIS Maps SDK for JavaScript 4.0
This object provides the framework and helper methods used in managing user credentials for the following resources:
- Secured ArcGIS.com, ArcGIS Enterprise portal, or ArcGIS Location Platform resources (e.g. web maps).
- ArcGIS Server resources secured using token-based authentication. Note that only ArcGIS Server versions 10 SP 1 and greater are supported. If your application accesses services from different domains, it is deemed a cross-domain request and you need to setup a proxy or use CORS (if supported by browser). If CORS is supported, the Identity Manager knows to make a request to the token service over https.
Authentication requests over http are prevented because sensitive data sent via GET can be viewed in server logs. To prevent this, the Identity Manager requires that you use POST over https to ensure your credentials are secure. View the proxy pages and CORS help topic for more details.
The IdentityManager module is slightly different than other modules in the API. Instead of returning a class constructor, it returns a singleton instance that has already been created by this module.
Variables
identityManager
The IdentityMananger instance. See the IdentityManagerBase module for more details on the methods and properties of the Identity Manager.
- Type
- IdentityManagerBase