Configure AUTH0 for IdP
Lighthouse can be added as an Enterprise application to AUTH0. This example uses “App roles” to grant users permissions.
Create an Application (Enterprise applications)
-
Go to Auth0.
-
Go to Applications > Application.
-
Click Create application.
-
Select Regular Web Application.
-
Name the application, for example, Lighthouse.
-
-
Go to Settings tab.
-
Select SAML.
-
Set Application Login URI to
-
In Allowed Callback URLs add each address for each lighthouse that you wish to allow users to sign-in via. (that is, IP, hostname, dns for both primary and dependent).
https://{primary lighthouse address}/api/v3.7/sessions/saml/sso/auth0
https://{primary lighthouse IP address}/api/v3.7/sessions/saml/sso/auth0
https://{secondary lighthouse address}/api/v3.7/sessions/saml/sso/auth0
https://{secondary lighthouse IP address}/api/v3.7/sessions/saml/sso/auth0 -
Click Save.
-
Go to the Addons tab:
-
Click SAML2.
-
Go to the SAML settings tab.
-
Set the Settings json to
{
"audience": "lighthouse-auth0",
"mappings": {
"roles": "LH_Groups"
},
"passthroughClaimsWithNoMapping": true,
"mapUnknownClaimsAsIs": true,
"nameIdentifierFormat": "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress",
"nameIdentifierProbes": [
"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress"
]
}-
Click either Enable or Save.
-
-
Go to Auth Pipeline.
-
Go to Rules.
-
Click Create.
-
Select empty rule template.
-
Name it appropriately, for example, Map roles to SAML user property.
-
Set the script to
-
https://{main lighthouse address}/api/v3.7/sessions/saml/sp_init/auth0
function mapSamlAttributes(user, context, callback) {
user.roles = (context.authorization || {}).roles;
callback(null, user, context);
}
-
Click Save.