Login flow
Identity logs people in with VATSIM once, remembers them, and hands each app a short-lived code. The app trades the code for its own session. It works the same on charts.flyindycenter.com and on a laptop. This page explains the flow; Auth has the code to add it to an app.
First login
Section titled “First login”The app sends the user to identity. Identity sends them to VATSIM, gets the answer, and sends them back to the app with a code. The app never talks to VATSIM.
/login/callback in steps 6 and 7 is identity’s address for VATSIM to return to. Apps never link to it.
Every request after that
Section titled “Every request after that”The app keeps the session token on its side: in an HttpOnly cookie on its own origin if it has a server, in localStorage if it runs only in the page. On each request it sends the token to identity and gets back who the user is: their VATSIM details, their Indy Center roles, and whether they’re controlling or flying right now.
A second app
Section titled “A second app”Identity remembered the user in step 9, with a cookie of its own on auth.flyindycenter.com. When the user opens another Indy Center app, the login link goes to identity, identity recognizes them, and they come straight back with a code. VATSIM isn’t involved.
/logout logs the user out of every app.Production and localhost
Section titled “Production and localhost”| Concern | charts.flyindycenter.com |
localhost:5173 |
|---|---|---|
| Where the app sends the user | Identity’s /oauth/authorize, with its own address as redirect_uri |
Same |
| Allowed return addresses | https://flyindycenter.com and https://*.flyindycenter.com |
http://localhost, 127.0.0.1, [::1], any port |
| What comes back | A code, good for 60 seconds, usable once | Same |
| Where the token lives | Wherever the app keeps it | Same |
| How the app reaches identity | Service binding, in-process | HTTPS |
| The VATSIM account | The user’s real one | The developer’s real one: same user record, same roles |
Why a code instead of the token
Section titled “Why a code instead of the token”The address bar is the only path from identity back to the app, and addresses get logged, bookmarked, and pasted into chat. So identity puts a 60-second, single-use code there, and the app fetches the real token over a direct HTTPS call that nothing else sees. VATSIM Connect works the same way: identity gets a code from VATSIM in step 6 and trades it for the profile in step 8. This is the OAuth 2.0 authorization-code grant, which is also why tools like Moodle and Wiki.js can use identity without custom code.
Considered, not chosen: putting the session token in the redirect. It’s shorter by one call, but the token would sit in browser history and server logs for its full 30 days.
Considered, not chosen: one cookie on .flyindycenter.com shared by every app. It skips the code exchange in production, but it can’t reach localhost, so development would need a second flow. It also means an XSS bug on any subdomain exposes every app’s session. With a cookie per app, the damage stays in that app.