Skip to main content

Auth0 Action

This guide assumes you have an Auth0 tenant and a Satosa organization setup, and that you're ready to begin collecting interactions for a document. This integration will add an Auth0 action to your tenant that you can add to a workflow. It will allow you to use the hosted document page to accept acknowledgements from your users when they login to your application.

Cloning the repository

To begin, start by cloning the Auth0 action from our repository on GitHub:

git clone https://github.com/satosa-io/auth0-action.git

Installing dependencies

You will need a node version >=16.14 to install and deploy the Auth0 action.

npm install

Preparing to deploy

In order to use the Satosa Auth0 action, you will need to deploy it to your tenant. To do so, you will need to gather the following variables:

Satosa Variables

Satosa document

Once you have a document to collect acknowledgements for from your users when they login through Auth0, begin by navigating to that document in your Satosa dashboard and copying the link from the Preview button. You should have a URL that looks like this:

https://dashboard.satosa.com/organizations/01H5Z9ADASV2Q94V0TX5437X92/documents/01H5Z9QE7YZYQ7YMEJMYPXBE5M?revisionId=0&returnUrl=https%3A%2F%2Fdashboard.satosa.com%2Fdocuments%2F01H5Z9QE7YZYQ7YMEJMYPXBE5M%2Frevisions%2F0

Export the following variables from the link you copied:

export SATOSA_ORGANIZATION_ID=01H5Z9ADASV2Q94V0TX5437X92
export SATOSA_DOCUMENT_ID=01H5Z9QE7YZYQ7YMEJMYPXBE5M

Satosa API Key

Sastosa API Key

To use the Auth0 action, you will need a Satosa API key. Begin by navigating to the developers dashboard in Satosa and clicking Create API Key. We'll name it something like "Auth0" so we know what it's being used for. Copy and export the variable.

export SATOSA_API_KEY=48E35905ACC91366A23FB3633DA9BFF92E1B7E6C5B1ADEEAD5DD20DA170FE200

Auth0 Variables

Auth0 Settings

Navigate to your Auth0 dashboard, select your application, and copy the following from your settings:

export AUTH0_DOMAIN=satosa.us.auth0.com
export AUTH0_CLIENT_ID=4XTq9bvxjvUk8ZBWK3ZpBKemZqtMFN2N
export AUTH0_CLIENT_SECRET=xxxxxxxxxxxxx-xx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Custom Domain

If you're using an Auth0 custom domain, you'll need to export that variable separately.

export AUTH0_CUSTOM_DOMAIN=auth.satosa.com

Deploying the action

Now it's time to deploy the action, simply run the deploy script to add it to Auth0.

npm run deploy

Setting up the flow

Flows Tab

Now that we've added the action to Auth0, we will need to setup the flow that checks if our users have ackowledged the latest version of our document. Navigate to the Flows under the Actions tab in Auth0 and select Login.

Login Flow

Under the Custom actions library, drag and drop satosa into your login flow and Apply to the flow.

Testing the flow

Hosted document page

After a user logs into your Auth0 application, they should be prompted with our hosted document page to accept the latest version of the document.