description |
---|
Step-by-step guide to ingest event data from Auth0 into RudderStack |
Auth0 is a popular solution used by many companies to add authentication and authorization services to their applications. You can connect Auth0 to your application with just a few lines of code and also define the identity providers, i.e., how you want the users to log in.
This guide will help you set up Auth0 as a source in RudderStack.
By adding an Auth0 Authentication API webhook extension that points to RudderStack, you can send events to RudderStack whenever Auth0 generates an authentication log. This way, you can capture events related to logins and signups and send them to RudderStack.
In order to add Auth0 as a source in RudderStack, please follow these steps:
- From your RudderStack dashboard, click on Add Source. From the list of sources, select Auth0.
- Enter the name you want to assign to this source.
- Once you have entered the name of your source, click on Next and save the source.
- Head over to your Auth0 account and navigate to the Extensions page from the sidebar.
- Look for the extension Auth0 Authentication API webhooks, as shown:
- After selecting this option, you should be able to see the extension installation page as shown:
- At the bottom, select the LOG_TYPES option for which you want to forward the events to RudderStack.
- Add the WEBHOOK_URL as shown on the source settings page in your RudderStack dashboard.
The webhook URL is of the format:
<DATA_PLANE_URL>/v1/webhook?writeKey=<YOUR_AUTH0_SOURCE_WRITE_KEY>
- If you're using RudderStack Cloud, replace
<DATA_PLANE_URL>
with https://hosted.rudderlabs.com/. - If you're hosting your own Data Plane, replace
<DATA_PLANE_URL>
with your hosted Data Plane URL.
An example is as shown:
https://hosted.rudderlabs.com/v1/webhook?writeKey=1bCenS7ynqHh8ETX8s5Crjh22J
{% hint style="warning" %}
Make sure you add the writeKey
as the query parameter to the URL. This is required to prevent the webhook from failing for the lack of a valid write key.
{% endhint %}
Then, continue with the rest of the steps, as follows:
- Keep the authorization section as blank.
- You can disable the SEND_AS_BATCH setting to receive the events in separate requests. However, we recommend setting it to Enabled.
- Finally click on INSTALL to install the webhook on your Auth0 dashboard.
The webhook event from Auth0 is ingested into RudderStack after converting it into the RudderStack event format. The user_id
set by Auth0 is converted to userId
.
The following table lists the properties populated from the Auth0 event payload directly to the RudderStack event:
Auth0 Property | RudderStack Property |
---|---|
client_id |
properties.client_id |
client_name |
properties.client_name |
details |
properties.details Note: These are the unmodified details sent by Auth0. |
auth0_client |
properties.auth0_client |
log_id |
properties.log_id |
isMobile |
properties.is_mobile |
description |
properties.description |
ip |
context.request_ip |
details.auth.user.email |
context.traits.email |
details.auth.user.name |
context.traits.name |
user_name |
context.traits.user_name |
user_agent |
context.userAgent |
If you're unable to see any events flowing from the Auth0 API webhooks to RudderStack, you can troubleshoot the issue by viewing the API webhooks logs. To do so, go to your Auth0 dashboard and navigate to Monitoring - Logs.
{% hint style="info" %} Refer to the Auth0 documentation for more information on this issue. {% endhint %}
If you come across any issues while configuring Auth0 as a source, feel free to contact us or start a conversation on our Slack channel.