Configure a dedicated Auth0 tenant
Use the tracked reconciler to configure one dedicated Auth0 tenant for one neobank deployment. This guide covers tenant domains, Management API credentials, permissions, planning, apply, verification, and runtime credential deployment.Check the prerequisites
Prepare these items before creating reconciliation credentials:- An Auth0 tenant dedicated to this neobank deployment
- An Auth0 Dashboard account with permission to create applications and API grants
- An existing database connection, such as
Username-Password-Authentication - The final public application origin and API audience
- A verified custom domain, if the deployment uses one
- A clean repository checkout with dependencies installed
Identify the canonical and runtime domains
Auth0 uses two domain settings when a deployment has a custom domain:AUTH0_CANONICAL_DOMAIN: the Auth0 tenant hostname, such astenant.us.auth0.comNEOBANK_AUTH0_DOMAIN: the issuer hostname used by the neobank, such aslogin.bank.example
https:// and /api/v2/ to get AUTH0_CANONICAL_DOMAIN.
Open Branding → Custom Domains to confirm that the runtime custom domain has a ready status. Use that hostname for NEOBANK_AUTH0_DOMAIN. Use the canonical hostname for both settings when you do not use a custom domain.
The Management API audience always uses the canonical tenant domain. The reconciler builds this audience from AUTH0_CANONICAL_DOMAIN.
Create the Management API application
Create a dedicated machine-to-machine (M2M) application for reconciliation:- Open Applications → Applications in the Auth0 Dashboard.
- Select Create Application.
- Enter a descriptive name, such as
Neobank Auth0 Reconciler. - Select Machine to Machine Applications.
- Select Auth0 Management API.
- Grant the temporary permissions listed below.
- Select Authorize.
update:client_grants lets verification reduce this application to read-only access. Regrant the write permissions before a later apply.
Copy the Management API client ID and secret
Open the M2M application after authorization. Copy its Client ID and Client Secret from the application’s Settings or Credentials tab. Store these values asAUTH0_MANAGEMENT_CLIENT_ID and AUTH0_MANAGEMENT_CLIENT_SECRET. They identify the reconciler itself. They are not the customer or operator application credentials.
Do not copy an API Explorer access token into .env.auth0. The reconciler exchanges the client ID and secret for a short-lived Management API token on every command. It never stores or prints that token.
Auth0 documents this flow in Register Machine-to-Machine Applications and Get Management API Access Tokens for Production.
Prepare .env.auth0
Create the ignored configuration file and restrict its mode before adding credentials:
NEOBANK_AUTH0_CLIENT_IDNEOBANK_AUTH0_CLIENT_SECRETNEOBANK_AUTH0_OPS_CLIENT_IDNEOBANK_AUTH0_OPS_CLIENT_SECRETAUTH0_OPERATOR_ROLE_ID
.env.auth0 as soon as Auth0 creates it. The file must remain owned by the current user with mode 0600.
Review the tenant plan
Fetch the tenant and generate an exact redacted plan:plan_hash only after confirming the entire plan.
Apply the approved plan
Apply the exact reviewed state with its plan hash:make auth0-plan again and review the new hash when this happens.
The reconciler performs these operations:
- Creates
<app name> Customerand<app name> Operatorregular-web applications - Configures
<API origin>/v1/session/callbackfor both applications - Creates
<app name> APIwith the exact configured audience and API scopes - Creates and deploys the
<app name> IdentityPost-Login Action - Creates the unassigned
<app name> Operatorrole - Enables TOTP, platform WebAuthn, security-key WebAuthn, and recovery codes
- Enables custom MFA factor challenges from Post-Login Actions
- Enables the configured database connection for both applications
- Detaches both applications from every other connection — social and enterprise alike — so no login can bypass the passkey and Guardian step-up model. An existing user whose only identity lives on a detached connection loses access at apply time.
- Binds the deployed Action to the Post-Login trigger
- Deletes only the non-system resources listed in the approved plan
Verify the tenant and reduce permissions
Verify the resulting tenant:"operations": []. A later apply requires the temporary write permissions again.
Deploy the generated runtime credentials
After apply,.env.auth0 contains the generated customer and operator application credentials:
Export only the runtime settings on the administration machine:
.env.runtime through Secure Copy Protocol (SCP). Set server to the SSH account
and host. Set server_dir to the repository directory on that server:
AUTH0_MANAGEMENT_CLIENT_ID, AUTH0_MANAGEMENT_CLIENT_SECRET, or
AUTH0_OPERATOR_ROLE_ID to the server or application containers.
On the server, merge these values into the protected server environment and prepare the
deployment:
/srv/neobank-wrapper with server_dir when you use another path. After the server
starts successfully, delete the administration-machine copy with rm -f .env.runtime.
See Single-server deployment for new-server and existing-server
safety requirements.
Auth0 tokens stay in the FastAPI back end. The frontend receives only the public application name, optional Arabic name, and mark from /v1/public-config.
Recover from reconciliation failures
Use the error message to select the recovery path:
Retries do not reuse a stale hash. A partial apply may create resources before a later operation stops, so generate a new plan and review its remaining operations.
Understand the Action claims and MFA behavior
The Action readsCLAIM_NAMESPACE, CUSTOMER_CLIENT_ID, OPERATOR_CLIENT_ID, and OPERATOR_ROLE_NAME from Action secrets. Its rendered code contains expected-value hashes and denies login when a secret drifts.
The Action maps the configured operator role to the stable operator claim value. It emits <claim namespace>/roles and can emit <claim namespace>/actor_type for configured machine clients. Operator login always requires multifactor authentication (MFA), while customer MFA follows explicit step-up requests. A primary passkey satisfies the step-up request. Otherwise, the Action challenges an enrolled factor before offering a new enrollment.
The tracked Action source contains no tenant domain or bank-specific value.