š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 Tenants you will use for production and sandbox.
Please visit the Astral API Portal Launcher 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:
Setup Auth0 Clients
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
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
Open a local development environment with tools including Git for source version control, and Node.js and npm to install and run the Auth0 Deploy CLI locally.
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:3000 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.js
to UI visuals:
![](https://astral-dx.gitbook.io/~gitbook/image?url=https%3A%2F%2F344324742-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F6Yq3fV353s4UTq6XBdxK%252Fuploads%252Ft921pIultpCNdpslAo2t%252FPortal.Config%2520.png%3Falt%3Dmedia%26token%3Dc7fc8fe9-4630-4cda-a3d3-7d0f5a50850d&width=768&dpr=4&quality=100&sign=28f01602&sv=2)
![](https://astral-dx.gitbook.io/~gitbook/image?url=https%3A%2F%2F344324742-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F6Yq3fV353s4UTq6XBdxK%252Fuploads%252FbSN5Ntm9IQEpdYUaJCx8%252FAdmin%2520Local%2520.png%3Falt%3Dmedia%26token%3D75a75ac2-6c66-4359-af80-071a1fa4f5a2&width=768&dpr=4&quality=100&sign=a05c7b45&sv=2)
![](https://astral-dx.gitbook.io/~gitbook/image?url=https%3A%2F%2F344324742-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F6Yq3fV353s4UTq6XBdxK%252Fuploads%252Fq2dYBSZdNUKMIgL01vdY%252FAdmin%2520View.png%3Falt%3Dmedia%26token%3D80923450-00c6-4bd6-9dd4-287953f3a7b0&width=768&dpr=4&quality=100&sign=164ce25c&sv=2)
New to Auth0 for User and Team Management? Checkout this free setup from Auth0:
Last updated