Audience: PMs, QA, Support, Implementation. What this answers: what the identity layer is, in product terms — how a person logs in, how "which company am I in" works, and how access is decided.
Written from code. Engineering detail lives in technical.md. Screens live in configuration.md and how-to.md.
PaidHR is multi-tenant: one platform serves many companies, and the same person can belong to several of them (a payroll consultant, an employee who is also an HR admin, a group with sub-companies). This subsystem is the shared foundation that keeps those worlds separate and safe. It does three jobs, on every request:
If any of the three is wrong, everything downstream is wrong — a Payroll Admin at Company A must never see Company B's payroll. That guarantee is enforced here, once, so no other module has to.
There are three doors:
| Door | Who | How |
|---|---|---|
| Password login | Most users | Username + password → Authenticate. |
| SSO / OAuth | Companies using Google or Microsoft | Google/Microsoft sign-in → SsoAuthenticate / OAuthAuthenticate. |
| Control login | Internal PaidHR staff | Separate Control/Authenticate door into the control panel. |
A login attempt does not always end in "you're in." It can return one of several outcomes: