Auth0
Auth0 handles user authentication. When a user signs in, Auth0 issues a JWT access token which the app passes to auth-svc to register and identify the user.
A.1 Create an Auth0 account and application
-
Sign up at auth0.com — the free tier is sufficient for development.
-
Go to Applications → Create Application.
- Choose Native as the application type (required for mobile).
- Note down the Domain and Client ID.
-
Under your application's Settings, scroll to Advanced Settings → Grant Types and make sure Refresh Token is enabled. This allows the
offline_accessscope to work, which keeps users signed in across app restarts.
A.2 Create an API
- Go to Applications → APIs → Create API.
- Set a Name (e.g.
auth-svc-api) and an Identifier — this is a logical name for your API, not a real URL (e.g.silent-shard-boilerplate). The identifier becomes yourAUTH0_AUDIENCE. - In the API's Settings tab, enable Allow Offline Access. This lets the app request refresh tokens for your API when it asks for the
offline_accessscope. - Under the Permissions tab, add the following custom API scopes:
| Scope | Description |
|---|---|
write:backup | Create / update keyshare backups |
read:backup | Retrieve keyshare backups |
read:transactions | View transaction history |
write:devices | Register / update devices |
read:devices | View registered devices |
write:face | Register face biometric |
read:face | View face registration status |
A.3 Configure callback URLs
Under your application's Settings, add the following to Allowed Callback URLs and Allowed Logout URLs:
# iOS
{YOUR_BUNDLE_ID}.auth0://{YOUR_AUTH0_DOMAIN}/ios/{YOUR_BUNDLE_ID}/callback
# Android
{YOUR_PACKAGE_NAME}.auth0://{YOUR_AUTH0_DOMAIN}/android/{YOUR_PACKAGE_NAME}/callback
Replace {YOUR_BUNDLE_ID} and {YOUR_PACKAGE_NAME} with the values from your app.config.ts.
A.4 Optional: Enable Google SSO
- Go to Authentication → Social → Create Connection → Google / Gmail.
- Provide your Google OAuth web client credentials (from Google setup).
- Enable the connection for your Native application.
A.5 Optional: Enable Passkey
- Go to Authentication → Passwordless.
- Enable Passkey and follow the setup wizard.
A.6 Add values to .env
EXPO_PUBLIC_AUTH0_DOMAIN=your-tenant.auth0.com
EXPO_PUBLIC_AUTH0_CLIENT_ID=your_client_id
EXPO_PUBLIC_AUTH0_AUDIENCE=silent-shard-boilerplate
The EXPO_PUBLIC_AUTH0_AUDIENCE value must exactly match the Identifier configured in your Auth0 API. A mismatch causes token verification to fail on the backend.