Make sure to have a licensed copy of WorkflowGen installed and running on a server. You must be a WorkflowGen administrator.
Make sure to have Auth0 administrator access.
Make sure to have provisioned an existing Auth0 user that you can authenticate with to WorkflowGen and that the user has administrator privileges. This is important because once you activate the delegation, you'll need to still be able to manage the application. (The Auth0 user is in fact a user of an identity provider that's linked to Auth0, such as GitHub or Google. You have to have provisioned at least one user.)
AES encryption mode and its key are required for the authentication to work.
To test your configuration after you complete the steps below, you can add an Auth0 user in the Users section of the Auth0 portal.
When importing users into WorkflowGen from the Auth0 database, make sure to set the username as the email (e.g. john.doe@example.com
).
The configuration of Auth0 is done in several steps. First, you have to register the WorkflowGen web application and link it to your instance of WorkflowGen; then, you have to register the WorkflowGen GraphQL API to be able to register custom applications to access it.
Go to the Auth0 portal Applications section.
Click Create Application, and fill in the form:
Name: WorkflowGen Web App
Type: Regular Web Application
Click Create. You should now see the application's Quick Start page:
On the Settings tab, scroll down to the Allowed Callback URLs section and add https://<workflowgen url>/auth/callback
to it.
Scroll down to the Allowed Logout URLs section and add https://<workflowgen url>/auth/logout/return
to it.
Your WorkflowGen Regular Web App is now configured.
Now, you need to register the WorkflowGen GraphQL API module so that applications external to WorkflowGen can use the API by authentication through Auth0 using the OpenID Connect protocol.
Go to the Auth0 portal APIs section.
Click Create API, and fill in the form:
Name: WorkflowGen GraphQL API
Identifier: https://<workflowgen url>/graphql
Signing algorithm: RS256
Your form should look like this:
Click Create.
Go to the Auth0 portal APIs section.
Click Create API, and fill in the form:
Name: My APIs
Identifier: my-apis
Signing algorithm: RS256
Click Create.
Click Permissions.
In the Define all the permissions (scopes) that this API uses section, enter the following information:
Permission: wfgen-graphql-full-access
Description: Full access to the WorkflowGen GraphQL API
Click ADD.
The GraphQL API is now registered in Auth0.
In order to get a proper username from the access token when receiving one in the GraphQL API, you need to use a special feature of Auth0 called an action. Actions act as middleware between the linked cloud provider and Auth0 in order to get the correct values when needed.
Go to the Auth0 portal and select Actions in the left menu, then select Library in the sub-menu.
Click Create Action, then choose the Build from scratch template.
Replace the code with the following:
Click Deploy.
Go to the Auth0 portal and select Actions in the left menu, then select Flows in the sub-menu.
On the Flows page, click the Login icon.
In the right panel of the graphical view, select the Custom tab, where your custom action should appear.
Drag and drop your action between the Start and Complete actions.
Click the Apply button in the top right.
This step will ensure that WorkflowGen and the GraphQL API always get a username through the same claim instead of having to make a lot of conditional statements. However, this doesn't apply to machine-to-machine authentication since there's no human user involved.
If you use a different claim from the Auth0 mapping than the one specified in the function above (e.g. user.username
, user.email
, user.nickname
), just modify this rule or add your own. Make sure to populate https://api.workflowgen.com/username
with the value or to configure the ApplicationSecurityAuthUsernameClaim
option in your web.config
with the correct claim to take. Note that this option is used both in the authentication application and the GraphQL API.
Now, you have to configure WorkflowGen to delegate its authentication to Auth0.
web.config
Open the WorkflowGen web.config
file and add the following properties under <appSettings>
:
Classic usage:
With multi-audience support:
Replace <CLIENT ID>
with the client ID of the WorkflowGen Regular Web App in Auth0.
Replace <CLIENT SECRET>
with the client secret of the WorkflowGen Regular Web App in Auth0.
Replace <METADATA URL>
with the URL that you built earlier from your domain name in Auth0. The METADATA URL
is https://[YOUR_AUTH0_DOMAIN].auth0.com/.well-known/openid-configuration
.
Note that the ApplicationSecurityAuthUsernameClaim
key is set to the value entered in the rule earlier. Therefore, you can use any value here as long as you also modify the rule.
For information about available configuration options to use with your instance, see the Web and Application Configuration Parameters appendix.
WorkflowGen is now linked to Auth0 and back. The last thing left to do is configure a few more options in order to finish the internal wiring of WorkflowGen so that it can delegate its authentication.
In order to generate a session token, you need to add a few more settings to the web.config
.
Open the WorkflowGen web.config
file and add the following properties under <appSettings>
:
Replace <SECRET>
with a value that can't be guessed, such as a UUID.
The secret will be only accessible inside your instance of WorkflowGen, so when generating a session token, WorkflowGen will sign it with this secret in order to check the validity of all session tokens passed to it.
You now need to activate the delegation by replacing the authentication system in IIS and pointing WorkflowGen's modules to the correct authentication module.
In IIS Manager, click on the WorkflowGen application in the tree view.
Click the Authentication button.
Enable Anonymous Authentication, and disable all other authentications.
Perform these steps for all sub-applications as well.
web.config
files of certain modulesCertain modules need to have their authentication checked by the special Advantys.Security.JWTAuthenticationModule
WorkflowGen authentication module, but certain other modules should not because they are either public or aren't part of the global authentication system.
In the WorkflowGen web.config
, add the following property:
In the auth
module's web.config
, add the following property:
This line removes the authentication Node.js module from the global authentication system, because this Node.js application encapsulates the OpenID Connect authentication mechanisms.
Repeat the above two steps for the hooks
and scim
modules as well.
Copy the following .NET assemblies and dependency libraries from \wfgen\bin
to each custom webform's \bin
folder (\wfgen\wfapps\webforms\<custom webform>\bin
):
Advantys.My.dll
Advantys.Security.dll
Newtonsoft.Json.dll
jose-jwt.dll
You should now have a working WorkflowGen instance with the authentication delegated to Auth0 through the OpenID Connect protocol. Make sure to have provisioned your users to WorkflowGen in order for them to successfully access WorkflowGen.
This feature is not supported for Auth0. It is necessary to configure the GraphQL API on the provider.
Give the action a name (e.g. WorkflowGen (Action)
). Trigger should be set to Login / Post Login and Runtime set to Node 18 (Recommended).