Skip to content

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.

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.

Browser the user App charts, or localhost Identity auth.flyindycenter.com VATSIM Connect 1 opens the app, not logged in 2 "Connect with VATSIM" link 3 GET /oauth/authorize?redirect_uri=… 4 302 to VATSIM, remembers where to return 5 user logs in to VATSIM 6 302 to identity's /login/callback?code&state 7 GET /login/callback 8 trade VATSIM's code, fetch profile VATSIM profile 9 save the user, mint a code, remember the user 10 302 to the app with ?code=… 11 GET /?code=… 12 POST /oauth/token with the code session token for this app 13 logged-in page, app keeps the token
Steps 3 to 10 are identity's job. The app does steps 2, 11, 12 and 13, and the client library does 12 and most of 13.

/login/callback in steps 6 and 7 is identity’s address for VATSIM to return to. Apps never link to it.

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.

Browser the user App keeps the token Identity RPC or HTTPS opens any page GET /oauth/userinfo · Bearer token user, roles, position or flight plan page
A deployed Worker makes this call in-process over its service binding. Anything else makes it over HTTPS. The answer is the same.

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.

Browser known to identity Second app wiki, training, … Identity auth.flyindycenter.com GET /oauth/authorize?redirect_uri=…, user known 302 straight back with ?code=… GET /?code=… POST /oauth/token, own session
Each app ends up with its own session. Logging out of one app leaves the others logged in. Identity's /logout logs the user out of every app.
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

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.