Prerequisites
To follow this guide you’ll need:- An Auth0 Account
- A client-side app using Auth0 for user authentication. See code examples to create one
Configure login flow
Use the following instructions to authenticate embedded app users with Superblocks by requesting a session token when logging users into Auth0 using Auth0 Login Flow.Step 1. Generate an Embed access token
To get Superblocks session tokens for your Auth0 users, you’ll need an Embed access token. See docs on Access Tokens to see how to Create an Embed access token.Step 2. Add Superblocks Login action
Add an action to get a user session token from Superblocks.- Navigate to Auth0 Dashboard → Actions → Library, then select Create Action → Build from scratch
-
Enter the following in the Create action form, then select Create
Field Value to enter Name Superblocks Login Trigger Login / Post Login -
Click Add secret and configure it as follows, then select Create
Field Value to enter Key SUPERBLOCKS_TOKENValue Paste in the Embed access token you created in Step 1 - Click on the Dependency icon in the left sidebar
-
Click Add dependency. In the Name field specify
axios, then click Create - Copy/paste the following Action into the code editor
- Click on the Test icon in the left side panel. Test the action to make sure it runs without any errors
- Click Deploy to save and deploy the action
Step 3. Add Superblocks Login action to login flow
Now that you have a Superblocks Login action, you can add it to your Auth0 Login Flow so a session token is generated each time a user logs in using Auth0.- Navigate to Auth0 Dashboard → Actions → Flows
- Select the Login flow and drop Superblocks Login into the flow
- Select Apply
Step 4. Pass token to your embed
Your login flow is now configured to add asuperblocks_token to the user’s idToken each time the user logs in via Auth0.
To get the superblocks_token, either decode the idToken stored by Auth0, or use an Auth0 SDK and access the token as follows:
src/views/embed_page.tsx
Your user is now authenticated with Superblocks! Go further with SSO by reading the full docs on Embedded App Authentication.

