Who is signing in?
Authentication checks a person’s identity, for example with a password or a passkey. An additional factor can add another check. A session then records that the person is signed in, so they do not have to prove their identity again on every page.
Account recovery is part of this process too. Recovering a lost login needs the same care as the original way into the account.
Which receipts can Lea open?
Authorization checks whether a person is allowed to perform a particular action. In the expense example, Lea can open and edit her hotel receipt. That does not give her permission to open a colleague’s claim.
Roles can group permissions for employees and finance staff. Access may also depend on who owns a record. The application has to enforce these rules whenever someone accesses the relevant data. Hiding a button is not enough.
When someone leaves the team
Accounts, invitations, recovery, and session expiry all need ongoing attention. When someone leaves, their permissions need to be revoked. Existing sessions and access tokens need to be considered as part of that process.
Building auth yourself means maintaining these processes alongside the application’s main features. Clear access rules matter, as does checking that they hold when someone sends a request directly to the server.
Accounts and team access in MainPath
You register with MainPath using email and password or a passkey. The same account also works for GitLab. Projects belong to an organization, where an administrator can invite other people under Users.
This covers access to MainPath and the project team. Deciding who can see which receipts in your own application is a separate part of its design. Create your first project explains how to set up your account and organization.