How to access user information

It is possible to use authentication and access user information while developing bundles and apps with map.apps for Developers.

Use the Identity Service

You can connect your map.apps for Developers project to an Identity Service. Doing this will enable you to access user information from ArcGIS Online, an ArcGIS Enterprise portal or a Keycloak instance.

To connect to an Identity Service add the following properties to the file of your map.apps for Developers project:
# Enable the Identity Service integration

# Base URL of the Identity Service

# This has to be the URL of the ArcGIS Online organization or
# the URL of the ArcGIS Enterprise portal
# The value must match the configuration from the Identity Service
# security.oauth.provider.arcgis.url

# (Optional) name of the Identity Service session cookie (default: ctIDENTITY)
# The value must match the configuration from the Identity Service

# (Optional) Add the Identity Service as 'trustedServer',
# so that the cookie is also sent for cross domain requests

Also you need to add the authentication bundle to your app to be able to log in and access the user information.

The following example shows the configuration to use an Identity Service running at http://localhost:8080 connected to an ArcGIS Enterprise portal while map.apps for Developers runs on http://localhost:9090.

# The value must match the configured portal
# Necessary to send cookie via proxy
As of security reason there will be no cookie sent when trying to connect map.apps for Developers running at http://localhost to a remote Identity Service running under HTTPS, e.g. Therefore, no authentication will be possible. To solve this, run map.apps for Developers under HTTPS as well.