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 want to allow users to sign-in via (that is, IP, hostname, dns for both primary and secondary).
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 Actions > Triggers > post-login.
-
Click Add Action.
-
Select Build from Scratch.
-
Name the build, for example Lighthouse Roles to Groups SAML mapping.
Note: Leave the Trigger and Runtime unchanged.
-
Click Create.
-
Update the Handler to:
exports.onExecutePostLogin = async (event, api) => {
if (event.authorization && event.authorization.roles) {
api.user.setAppMetadata("roles", event.authorization.roles);
}
};
https://{main lighthouse address}/api/v3.7/sessions/saml/sp_init/auth0
-
Click Save and Deploy.