šŸ”Deploying with Auth0

For this deployment method, using your Auth0 credentials in the Astral Auth0 Plugin, will streamline User Management, Team Management, and API Credentials.

To use Auth0 for your Astral Dx Portal API Credential Management you will need to set up two Auth0 ā€œMachine-to-Machineā€ clients, one for your production environment and one for your sandbox environment. To get started create or select the Auth0 Tenantsarrow-up-right you will use for production and sandbox.

Please visit the Astral API Portal Launcherarrow-up-right to configure and download your API Portal.

If you are using Auth0 for API credentials, you can deploy an API Developer Portal quickly with two steps:

  1. Setup Auth0 Clients

  2. Test your API Portal Locally and Deploy

View an end-to-end training video for deploying in under 10 minutes

Step 1: Setup Auth0 Clients

  1. Within Auth0, select your production tenant using the tenant dropdown

2. Navigate to ā€œApplicationsā€ using the left side navigation and select ā€œApplicationsā€ \

3. Select ā€œCreate Applicationā€

4. Set the name of the new application to ā€œAstral Backendā€ and choose ā€œMachine to Machine Applicationsā€ as the application type

5. Select ā€œAuth0 Management APIā€ and enable read, write, update, and delete for the following permissions:

  • client_grants

  • users

  • users_app_metadata

  • clients

  • client_keys

6. Open the ā€œSettingsā€ tab on the application you have just created and provide the values as the following environment variables to your Astral Dx Portal

  • Domain: PRODUCTION_AUTH0_MANAGEMENT_CLIENT_DOMAIN

  • Client ID: PRODUCTION_AUTH0_MANAGEMENT_CLIENT_ID

  • Client Secret: PRODUCTION_AUTH0_MANAGEMENT_CLIENT_SECRET

7. Follow Steps 1 through 5 within the context of your Auth0 Sandbox tenant to create a second set of Astral Backend credentials (for your sandbox environment) and provide the values as the following environment variables

  • Domain: SANDBOX_AUTH0_MANAGEMENT_CLIENT_DOMAIN

  • Client ID: SANDBOX_AUTH0_MANAGEMENT_CLIENT_ID

  • Client Secret: SANDBOX_AUTH0_MANAGEMENT_CLIENT_SECRET

8. Set Permissions for your first admin user

One time step. For the very first user to log into your portal you'll need to manually add the portal-admin permission within Auth0:

  • Navigate to "User Management", then "Users"

  • Find or create your user

  • Copy or amend the app_metadata to include the following property

Step 2: Test your API Portal Locally and Deploy

  1. Open a local development environment with tools including Gitarrow-up-right for source version control, and Node.js and npmarrow-up-right to install and run the Auth0 Deploy CLI locally.

  2. With the template repository, create an .env.local at the root of the project and provide any necessary environment variables.

3. Next, run the development server:

4. Open http://localhost:3000arrow-up-right with your browser to see the result.

You can start customizing your API developer portal by modifying portal.config.js. Refresh your page to see changes.

Example portal.config.jsto UI visuals:

portal.config
Admin View Example
Customer View Example

New to Auth0 for User and Team Management? Checkout this free setup from Auth0:

Last updated