- Log in to ArcGIS Enterprise portal as an administrator.
- Under the Organization tab, go to Settings and New member defaults.
- Click the pencil icon under User Type.
- Select
Lite
as the default User type and selectViewer
as the default Role. - Click
Save
.
- Log in to your Auth0 account and from your Auth0 dashboard, create a new Single Page Web Application.
- Select JavaScript as the technology you are using for your web app.
- Under the newly created app Settings, expand Advanced Settings.
- Select the Endpoints Settings and copy the
SAML Metadata URL
. - Log in to ArcGIS Enterprise portal as an administrator.
- Under the Organization tab, go to Settings and select Security.
- Under Logins select New SAML login. This is where Auth0 will be configured as a SAML Login Identity Provider.
- Select
One identity provider
and clickNext
. - Provide a Name for the Organization.
- Select the option for users to join Automatically.
- Under
Metadata source for Enterprise Identity Provider
, selectURL
and paste the SAML Metadata URL copied at Step 4. - Click
Save
.
- Log in to ArcGIS Enterprise portal as an administrator.
- Under the Organization tab, go to Settings and select Security.
- Under
Logins
, selectConfigure login
on the SAML login. - Select
Download service provider metadata
to extract the ArcGIS Enterprise metadata required to further configure Auth0. - Save and open the downloaded XML file.
- From XML file, copy the signin URL located in the
AssertionConsumerService
tag. The URL should have the following pattern: https://hostname.fqdn/webadaptor/sharing/rest/oauth2/saml/signin - Return to the Single Page Application Settings in your Auth0 Dashboard.
- Select the
Addons
tab. - Enable the
SAML2 WEB APP
addon. The configuration dialog will open. - Select the
Settings
tab, and paste the URL copied in Step 6 into theApplication Callback URL
input box. - Scroll to the bottom of the configuration dialog and select
Enable
andSave
.
NOTE: In this section of the instructions we will need to customize the SAML Assertion generated by Auth0. For more information on these steps please review the Auth0 help topic on Customizing SAML Assertions
- Return to the Single Page Application Settings in your Auth0 Dashboard.
- Select the
Addons
tab. - Select
SAML2 WEB APP
to open the configuration dialog. - Select the
Settings
tab, and replace the JSON text in the Settings dialog with the following:{ "mappings": { "nickname": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier", "email": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress", "name": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name", "given_name": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname", "family_name": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname", "upn": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn", "groups": "http://schemas.xmlsoap.org/claims/Group" } }
- Save the settings.
- Log in to ArcGIS Enterprise portal as an administrator.
- Under the Organization tab, go to Settings and Security.
- Under
Logins
, selectConfigure login
on the SAML login. - Select
Show advanced settings
. - Enable the following parameters:
- Enable Signed Request
- Enable Sign using SHA256
- Enable Propogate logout to Identity Provider
- Save the configured login properties.
- Open the ArcGIS Configuration text file and copy the signout URL located in the
SingleLogoutService
tag. The URL should have the following pattern: https://hostname.fqdn/webadaptor/sharing/rest/oauth2/saml/signout - Return to the Single Page Application Settings in your Auth0 Dashboard.
- Select the
Addons
tab. - Select the
SAML2 WEB APP
addon. The configuration dialog will open. - Select the
Settings
tab, and replace the JSON text in the Settings dialog with the following: NOTE: Be sure to use the URL copied from Step 7 as the callback parameter{ "logout": { "callback": "REPLACE_WITH_SIGNOUT_URL_FROM_ARCGIS_METADATA", "slo_enabled": true }, "mappings": { "nickname": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier", "email": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress", "name": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name", "given_name": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname", "family_name": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname", "upn": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn", "groups": "http://schemas.xmlsoap.org/claims/Group" } }
- Save the settings.
- Select
Settings
in your Auth0 Single Page Application. - Add the callout parameter copied from Step 7 under the
Allowed Callback URLs
. - Select
Save Changes
.
Optional Step: Create Auth Pipeline Rule to Encrypt the AuthO Assertion (Recommended for Production)
NOTE: While encrypting the SAML Assertion is not neccesary to complete this walkthrough, it is a recommended configuration for securing production environments.
NOTE: Auth0 supports encrypting the SAML Assertion by using an Auth Pipeline Rule. A Rule is a custom snippet of JavaScript code that allows an administrater to add custom logic to the authentication pipeline. The rule created in this session will programatically provide the Public Key and Certificate to use when encrypting the SAML Assertion returned to ArcGIS Enterprise. For more information regarding the steps outlined in the following section please see the Send encrypted SAML authentication assertions in the Sign and Encrypt SAML Requests Auth0 help topic.
NOTE: You must manually configure Auth0 to encrypt the SAML Assertion using a certificate generated by ArcGIS Enterprise. This Certificate, and its Public Key, must be converted to a single line string so that it can be added to the JavaScript Block of the Auth0 Rule.
NOTE: This step requires OpenSSL to convert the contents of the ArcGIS Enterprise DER (Distinguished Encoding Rules) certificate for signing SAML assertions to a PEM (Primary Enhanced Mail) certifcate. OpenSSL is readily available on Linux and MacOS. If using Windows, you can use the Linux Subsystem for Windows 10 and install an Ubuntu Container, Cygwin, a docker container running Ubuntu, or install one of the existing versions for Windows. The steps listed in these instructions were generated on a machine running MacOS.
NOTE: This section uses the Portal Administrator Directory to export the ArcGIS Enterprise Certificate for signing SAML Assertions.
-
Open a browser and navigate to your Portal Administrator Directory:
https://hostname.fqdn/webadaptor/portaladmin/
-
Login as an administrative user
-
Navigate to Security -> SSLCertificates
-
Select the certificate named
samlcert
. -
Select
Export
to download the file. -
Open a terminal or command prompt and browse to the directory containing the DER encoded certificate.
-
Convert the certifcate to a PEM certificate file using the following command:
openssl x509 -inform der -in samlcert.cer -out samlcert.pem
-
Extract the Public Key from generated PEM certificate file using the following command:
openssl x509 -in samlcert.pem -pubkey -noout > samlcert_pubkey.pem
-
Open the PEM files generated in steps 7 and 8. To convert the multi-line text to a single line, replace all line endings (newlines) with
\n
.Here is a sample file before being editted:
-----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlzzj6QkuEqnThoi5qTvr 7baPvvPRQO08FVolVZ1XtPDwZUx6r4rOWaOuEdi8IKlkLyh5HjSHbYVE8PqJZ+2x Voq11rW4zQOf8zf6wM3nkn3AjrIgg1cBt51r5B9vnBsjjI7a2lWFS9ITY9scEtyu NT8Pxu20FuNAalb4vh5drRCZpufrwHtyFaanDLmcCGaPnnGuM5AU4ZynDqrS46Dp LFHWp1wb+/WU/Ix1LtC8UeO0gXyObMFARnA5L+XPYqESzjDxZ1mQrTMuXoVTo7Nm tclbeEWgMBytllsWnYg1UuWfvAfwt38YstlSy62VFo6002UUygXD/DLvxwJhN/3T AwIDAQAB -----END PUBLIC KEY-----
and the same file after being editted. Please note, the text below is a single line regardless of how appears in the Markdown editor.
-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlzzj6QkuEqnThoi5qTvr\n7baPvvPRQO08FVolVZ1XtPDwZUx6r4rOWaOuEdi8IKlkLyh5HjSHbYVE8PqJZ+2x\nVoq11rW4zQOf8zf6wM3nkn3AjrIgg1cBt51r5B9vnBsjjI7a2lWFS9ITY9scEtyu\nNT8Pxu20FuNAalb4vh5drRCZpufrwHtyFaanDLmcCGaPnnGuM5AU4ZynDqrS46Dp\nLFHWp1wb+/WU/Ix1LtC8UeO0gXyObMFARnA5L+XPYqESzjDxZ1mQrTMuXoVTo7Nm\ntclbeEWgMBytllsWnYg1UuWfvAfwt38YstlSy62VFo6002UUygXD/DLvxwJhN/3T\nAwIDAQAB\n-----END PUBLIC KEY-----\n
-
Connect to your Auth0 Dashboard.
NOTE To complete the next set of steps you will need to know your Auth0 Single Page Application's Client ID.
-
Copy the
Client ID
from theBasic Information
section of your Auth0 Single Page application's settings tab. -
Select Auth Pipeline -> Rules.
-
Select
Create
to create a new rule. -
Select the
Empty rule
template. -
Provide a descriptive name for the rule
-
Copy the following JavaScript snippet into the Script editor.
function (user, context, callback) { if (context.clientID === 'The Client ID copied in step 11') { context.samlConfiguration = (context.samlConfiguration || {}); context.samlConfiguration.encryptionPublicKey = "-----BEGIN PUBLIC KEY-----[..entire string created in step 9]-----END PUBLIC KEY-----\n"; context.samlConfiguration.encryptionCert = "-----BEGIN CERTIFICATE-----[..entire string created in step 9]-----END CERTIFICATE-----\n"; } return callback(null, user, context); }
-
Select
Save Changes
-
Log onto Portal for ArcGIS Enterprise as an Administrator
-
Select Organization -> Settings -> Security.
-
In the
Logins
section, selectConfigure Login
. -
Select
Show advanced settings
. -
Enable
Encrypt Assertion
. -
Save the configuration changes.
NOTE: The Auth0 Sample App requires that either NodeJS LTS or Docker is installed and uses the Auth0 JavaScript Login Tutorial.
- Log into your Auth0 account. From your Auth0 dashboard, click on
Applications
, then select your ArcGIS app. - Navigate to the
Quick Start
tab. - Select
JavaScript
to open the JavaScript tutorial. - In the JavaScript: Login tutorial, click
DOWNLOAD SAMPLE
. Follow the Auth0 Tutorial.
- Open a Terminal or command prompt and browse to the extracted 01-login folder.
- If you are running the application using NodeJS, you will use
npm install && npm start
to launch the application. - If you are running the application using Docker, you will either use
exec.sh
(Linux / MacOS) orexec.ps1
(Powershell in Windows) to launch the application. - Once the application is running, open a browser and navigate to http://localhost:3000
- Select the Login button and provide credentials for an Auth0 user to test that the application works.
- Log into your ArcGIS Enterprise organization as the user that will own the application.
- Under the
Content
tab, click onNew item
. - In the New item dialogue box, select
Application
. - For Application type, select
Web mapping
, then set the URL to http://localhost:3000 and clickNext
. - Provide a title, tags and summary for the App Registration, then click
Save
. - Once the item is created, click the
Settings
tab. - Under Web Mapping Application, click
Register
. - Set the Redirect URL to http://localhost:3000/map.html then click
Add
. - Select
Register
.
NOTE: The map.html file referred to in this section was created using two ArcGIS Maps SDK for JavaScript code samples available from https://developers.arcgis.com:
- Create a new file called
map.html
in the/01-login/public
folder of the Auth0 Sample App. - Navigate to the map.html file on GitHub.
- Copy raw contents and paste to your map.html file in /01-login/public.
- In ArcGIS Enterprise, under the
Content
tab, click on your web app then click theSettings
tab. - Under Web Mapping Application, click
Registered Info
. - Copy the
App ID
. You will use it in an upcoming step. - In the
map.html
file in the /01-login/public folder, replace the following URLS:your_portal_url
– ArcGIS Enterprise portal URLyour_app_id
– The App ID from your registered app in ArcGIS Enterpriseyour_fs_service_URL
– The secure layer you wish to use in the map. This example uses the SampleWorldCities service that is created by default when ArcGIS Enterprise is installed.
Save
.- Open
/01-login.index.html
. - Find the
Home
navigation item. The code looks like this:<li class="nav-item"> <a href="/" class="nav-link route-link">Home</a> </li>
- Add the following code under the
Home
item. This will cause users to navigate to the map.html page.<li class="nav-item"> <a href="/map.html" class="nav-link route-link">Map</a> </li>
- The code should now look like this:
<ul class="navbar-nav mr-auto"> <li class="nav-item"> <a href="/" class="nav-link route-link">Home</a> </li> <li class="nav-item"> <a href="/map.html" class="nav-link route-link">Map</a> </li> </ul>
- Run the application.
- Navigate to http://localhost:3000, log into the web application and then click on the
Map
tab to load the map.
NOTE: Before completing these steps, ensure that at least one Auth0 user is assigned the Administrator role in ArcGIS Enterprise. If an Auth0 user is not assigned as an administrator, portal administration will need to be performed programmatically. For more information on how to create an Auth0 user, review the Auth0 help topic Create Users.
- Log into your ArcGIS Enterprise as an administrator.
- Under the
Organization
tab, go toMembers
. Ensure that there is at least one member in the ArcGIS Enterprise organization with an Administrator role and that the user also has an existing account in Auth0. - Under the
Organization
tab, go toSettings
and selectSecurity
. - Under
Logins
, disable the ArcGIS login. - Navigate to http://localhost:3000, log into the web application and then click on the
Map
tab to load the map.