Skip to main content

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​

  1. The frontend starts sign-in at /challenge and receives a challenge.
  2. The frontend generates a signature and sends it to /verify for verification.
  3. If required, the frontend responds to password change, MFA, or device authentication challenges.
  4. 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.