Set up OpenID Connect (OIDC) using Auth0
You can set up OpenID Connect (OIDC) as an authentication method for SignServer AdminWeb login using Auth0.
If using the default HTTPS port 443, do not specify the port in the URLs. This causes a known issue when trying to log in. Instead use:
Allowed Callback URLs: https://<YourDomain>/signserver/adminweb/callback
Allowed Logout URLs: https://<YourDomain>/signserver
Prerequisites
An Auth0 account.
The application server running SignServer needs to support OIDC and have the appropriate extension(s) enabled. For SignServer software installations, refer to Application Server Setup and the sections about layers/extensions and any sections mentioning “OIDC”.
Step 1 - Configure your Application in Auth0
To set up the SignServer authentication in an Auth0 application:
Create an Application
In your Auth0 account, navigate to Applications.
Click Create New Application.
Choose Regular Web Applications as the type.
Navigate to Settings in your Auth0 application.
Set the following under Application URIs:
Allowed Callback URLs: https://<YourDomain>:8443/signserver/adminweb/callback
Allowed Logout URLs: https://<YourDomain>:8443/signserver
For more information, see the Auth0 Documentation Application Settings.
Click Save.
Set Allowed Logout URL
Navigate to the Settings for your Auth0 account.
Click on the Advanced tab in Tenant Settings.
In the Login and Logout section, set the following:
Allowed Logout URLs: https://<YourDomain>:8443/signserver
For more information, see Redirect Users After Logout.
Click Save.
Create a Trigger
Navigate to Triggers under Actions.
Choose
post-logintrigger.Click Create Action.
Fill in the Name field and click Create.
Add the following code in the trigger:
exports.onExecutePostLogin = async (event, api) => {
const namespace = 'kf.roles';
if (event.authorization) {
api.idToken.setCustomClaim('preferred_username', event.user.email);
api.idToken.setCustomClaim(`${namespace}`, event.authorization.roles);
}
}
Click Deploy.
Drop the new Action into the flow.
For more information, see the Auth0 Documentation Write Your First Action.
Click Apply.
Step 2 - Manage Auth0 User Roles
To complete the setup of your user profile in the Auth0 application, create and assign roles.
For more information and detailed steps, see User Accounts.
Navigate to User Management.
Create a new user.
Under Roles, create the following three roles:
admin
auditor
archive_auditor
In the User Configuration section, click Assign Roles and assign the roles you want to your user.
Step 3 - Configure SignServer for OIDC
To complete the OIDC setup, configure SignServer with the Auth0 values.
For more information, see Application Settings.
In the Auth0 application, find the following values under Application Settings:
Client ID
Client Secret
Domain (used in providerUri and providerLogOutUri)
Copy these values and paste them into SignServer, under the
conf/oidc.propertiessection.
For example, for oidc.providerUri, the value is similar to:
https://<domain>/
For oidc.providerLogOutUri, the value is similar to:
https://<domain>/v2/logout
Here is an example snippet of the oidc.properties:
#Sample for Auth0
oidc.clientId=xxxxxxclient-idxxxxxxxxxxxxxx
oidc.clientSecret=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
oidc.providerUri=https://dev-xxxxxxxxxxxxxxxx.us.auth0.com/
oidc.providerLogOutUri=https://dev-xxxxxxxxxxxxxxxx.us.auth0.com/v2/logout
oidc.logoutUri=https://localhost:8443/signserver
oidc.redirectUri=https://localhost:8443/signserver/adminweb/workers.xhtml
oidc.loginUri=https://localhost:8443/signserver/adminweb/callback
oidc.callerGroupsClaim=kf.roles
oidc.audience=xxxxxxclient-idxxxxxxxxxxxxxx
Re-deploy SignServer after the configuration changes.
The application server may fail to start SignServer if OIDC is configured but the application server is missing OIDC support.
See Prerequisites.