Auth API Implementation Guide
This guide describes how to implement a custom login screen using the SaaSus Platform Auth API.
See the sample application for an implementation example.
Sample features
The sample uses a React and TypeScript frontend and a Go backend.
It supports sign-in with an email address or login ID, as well as:
- Changing a temporary password after sign-in
- Signing in with, configuring, and disabling authenticator-app or email multifactor authentication (MFA)
- Remembering a device and signing in with a remembered device
- Displaying user information, refreshing tokens, and signing out
- An advanced example that constructs an email address from a username and a tenant attribute
Verify MFA, device remembering, token refresh, and other flows against the settings of your SaaSus Platform environment.
See the sample README for prerequisites and startup instructions.
Sign-in flow
The sample uses Secure Remote Password (SRP) for normal sign-in.
The browser generates a signature without sending the password itself to the backend.
Flow details
- The frontend starts sign-in at
/challengeand receives a challenge. - The frontend generates a signature and sends it to
/verifyfor verification. - If required, the frontend responds to password change, MFA, or device authentication challenges.
- After authentication, the backend stores the tokens in cookies.
The new password is sent to the backend when a password change is required.
When a challenge includes a session, pass it to the next response; this value is separate from the cookies used after sign-in.
Custom screen limitations
- There is no public API for users to reset their own password using a verification code.
- Google and SAML authentication returns to the SaaSus Platform provided screen.
- Tenant invitation email links point to the SaaSus Platform provided screen.