Install an Aurora satellite
A satellite is a Catalyst app that keeps no login form of its own. Unauthenticated users are bounced to the hub, the hub issues the tokens, and the satellite validates them against the hub’s JWKS. This step builds one and wires it to the hub from the previous steps.
This guide assumes the hub at http://localhost:8080, and the satellite frontend at http://localhost:4201 with its backend at http://localhost:8081. Adjust to your deployment. For the roles and token flow behind these steps, see Authentication strategies.
1. Scaffold the satellite
Section titled “1. Scaffold the satellite”catalyst new aurora-app1Then, in backend/.env, set the DATABASE_* connection (its own database — not the hub’s) and turn synchronization on so the tables are created:
DATABASE_SYNCHRONIZE = true2. Add the Authorization Code backend package
Section titled “2. Add the Authorization Code backend package”catalyst add backWhen prompted to Select a package to add, choose Authorization Code. This installs the BFF package that drives the /authorize → /callback → token round-trip. A satellite needs no iam/o-auth package of its own — identity lives on the hub.
3. Register the satellite’s client on the hub
Section titled “3. Register the satellite’s client on the hub”In the hub admin, open the Edit client dialog and create an OAuthClient:
- Grant Type →
Authorization Code. - Applications → the application the satellite belongs to (e.g.
Aurora). This links the client to theOAuthApplicationwhosecodethe satellite will send. - Name → a descriptive name for the satellite app.
- Redirect → the satellite’s callback, exactly:
http://localhost:4201/callback. It must be absolutehttp(s)with no trailing fragment (#); the hub matches it character-for-character at both/authorizeand the token exchange. - Set token lifetimes and Active = on, then save.
4. Configure the satellite backend .env
Section titled “4. Configure the satellite backend .env”In the satellite’s backend/.env:
OAUTH_STRATEGY = aurora-hubOAUTH_HUB_SERVER_URL = http://localhost:8080OAUTH_APPLICATION_CODE = auroraOAUTH_APPLICATION_SECRET = 'xxxxxxxxxxxxxxxxxxxx'OAUTH_REDIRECT_URI = http://localhost:4201/callback| Variable | What it is |
|---|---|
OAUTH_STRATEGY | aurora-hub selects satellite mode. The default is none — you must set it. |
OAUTH_HUB_SERVER_URL | Base URL of the hub backend. |
OAUTH_APPLICATION_CODE | The hub OAuthApplication.code. Sent as client_id. |
OAUTH_APPLICATION_SECRET | The hub OAuthApplication.secret. Used only in the backend’s HTTP Basic header — never shipped to the frontend. |
OAUTH_REDIRECT_URI | The satellite callback. Must equal the hub client’s Redirect exactly. |
If the satellite runs on the same host as the hub, give it distinct ports so the two don’t collide:
APP_URL = http://localhost:8081APP_FRONTEND_URL = http://localhost:4201APP_PORT = 80815. Point the satellite frontend at hub mode
Section titled “5. Point the satellite frontend at hub mode”In the active environment file (frontend/src/environments/environment.ts):
authStrategy: 'authorization-code',api: { graphql: 'http://localhost:8081/graphql', rest: 'http://localhost:8081/api',},authStrategyflips from the scaffold default'password'to'authorization-code'. This single field is the source of truth: it selects the code guard, drops the local login form, and routes sign-out to a terminal page.- The
apiendpoints point at the satellite’s own backend (the BFF) on:8081— not the hub. The/callbackround-trip POSTs here.
The /callback route ships pre-wired and unguarded; do not add an auth guard to it.
Then set the satellite frontend’s dev port in frontend/package.json so it doesn’t clash with the hub’s :4200:
"start:local": "ng serve --configuration local --port 4201"6. Restart and run
Section titled “6. Restart and run”Restart the satellite backend (the strategy is read once at boot), then start both apps.
7. Verify it worked
Section titled “7. Verify it worked”Open a protected route on the satellite and watch the round-trip:
- The browser is redirected to the satellite backend
…/api/auth/login, which 302s to the hub…/api/o-auth/authorizewithcode_challengeandcode_challenge_method=S256. - You log in on the hub, which redirects to
http://localhost:4201/callback?code=…&state=…. - The callback POSTs to the satellite
…/api/auth/token, tokens are stored, and you land authenticated.
Green checklist: no invalid_request (PKCE travelled), no call to /credentials (legacy gone), no 401 (the application secret matched), no redirect loop, and sign-out reaches the terminal page without bouncing back to the hub.
Troubleshooting
Section titled “Troubleshooting”| Symptom | Likely cause | Fix |
|---|---|---|
400 invalid_request | PKCE missing, or client_id is a UUID (legacy BFF) | Re-pull the BFF (catalyst add back --force); set OAUTH_APPLICATION_CODE to the application code. |
400 redirect_uri mismatch | Hub client Redirect ≠ OAUTH_REDIRECT_URI | Make them identical — absolute, no fragment. |
401 invalid_client | OAUTH_APPLICATION_SECRET wrong or truncated | Use the application secret; mind the $ quoting; confirm 60 chars. |
429 ThrottlerException | A redirect loop hammering the hub | Fix the underlying 4xx, then restart the hub (the throttle counter is in-memory). |
Blank page / NG04002 | Hub sign-in path misconfigured | Check the hub’s OAUTH_SIGN_IN_PATH (default /auth/sign-in). |
Related
Section titled “Related”- Authentication strategies — the three modes and the token flow.
catalyst add— add the Authorization Code package.