🔗 Centralized Authentication
The Aetoskia Auth Server acts as the single identity provider for every application in the Aetos Platform ecosystem. The model is deliberately small and uniform.
🧬 The identity model
- One issuer. All access tokens are signed with the same
JWT_SECRETusing HS256 and carrysub(the username) plus anexpclaim. - One user store. Users live in the shared MongoDB
userscollection; passwords are bcrypt-hashed and never leave the server. - Shared trust. Any service can validate a token locally with
jwtlib(decode + signature) or ask the server via/introspectfor a live answer. - No shared sessions. Logout is stateless: the token is discarded by the client, and further use is prevented only by expiry or revocation through introspection-driven policies.
🎟️ Token contract
A valid access token is an HS256 JWT with exactly two claims:
sub— the username of the authenticated user.exp— UTC epoch seconds of expiry (60 minutes by default).
There are no scopes or roles inside the token; authorization decisions belong to the consuming service, while identity and authenticity belong here.
🤝 How the ecosystem trusts the server
- Users authenticate once via
/loginand receive a token. - Services accept that token as proof of identity after verifying it
(locally via
jwtlibor remotely via/introspect). - Sensitive endpoints recover the user profile from the token through
get_current_useror the generated dependency — never by parsing JWTs by hand.
This keeps authentication centralized while leaving each service in control of its own authorization rules.
💡 Benefits
- New services onboard with a client library call, not a new auth system.
- Credential storage, hashing, and issuance policies evolve in one place.
- A single
JWT_SECRETrotation strategy protects the whole platform.
📚 Read Next
- How to Use — register, login, and call endpoints.
- Platform Integration — wiring the token into services.