Skip to main content

Authentication mechanism details

Authentication overview

Use the controls to enlarge the diagram. Pan horizontally and vertically when zoomed.

FinTrack uses Supabase Auth as its identity provider. The live identity inventory is predominantly phone-based. A restricted corporate-email login route is also implemented for approved administrative use.

Supported sign-in paths

PathUser inputValidation sequence
Phone loginTenant context, registered phone number, and passwordTenant and phone association are validated first; Supabase Auth then verifies the phone identity and password
Corporate-email loginApproved corporate email address and passwordThe application accepts only the approved corporate domain; Supabase Auth then verifies the email identity and password

The tenant-context value used during phone login is an account-routing and eligibility check; it is not a replacement for the user's password. Password verification remains with the managed identity provider.

Protocol and token model

ElementTechnical behaviorSecurity property
Identity assertionSupabase Auth validates the registered phone or approved corporate-email identity against the submitted passwordAuthentication is centralized in the managed identity provider rather than implemented in application tables
PKCE flowThe browser client uses Proof Key for Code Exchange for supported exchangesAn intercepted authorization response cannot be redeemed without the client-generated verifier
Access tokenA short-lived signed token is presented to managed APIs and protected operationsBackend services derive the authenticated subject from a verifiable token rather than a browser-supplied user identifier
Refresh tokenThe browser retains refresh capability and rotates the session through the identity providerLong-lived continuity is separated from individual access-token lifetime; replay and reuse controls remain provider configuration concerns
Application profileA linked profile adds tenant, hierarchy, account-status, and business-scope contextA valid identity without an eligible application profile does not receive an authorised application session
Authorization enforcementDatabase policies, storage policies, and trusted operations evaluate current server-side stateUI visibility and token claims do not independently authorize protected records or privileged actions

Authentication state machine

StateEntry conditionPermitted behaviorExit condition
UnauthenticatedNo usable signed session existsPublic application shell and login processing onlySuccessful password authentication or continued rejection
Identity authenticatedThe managed provider has issued a valid sessionResolve the linked application profile; protected business data remains unavailable until eligibility succeedsEligible profile, missing profile, inactive profile, or session failure
Application eligibleProfile is active and tenant context is validEstablish user context and request protected data through policy-enforced servicesExplicit sign-out, token failure, profile deactivation, or tenant-scope rejection
RefreshingAccess token approaches expiry or the application resumesSuspend assumptions based on stale identity state while the provider refreshes and the profile is recheckedRotated session returns to eligible state; failure returns to unauthenticated
RejectedCredentials, context, status, or policy evaluation failsReturn a non-sensitive failure and avoid exposing which validation predicate failedA new authentication attempt begins

Session lifecycle

StageControl
Session issuanceSupabase Auth issues a signed access-token and refresh-token pair after successful password authentication
Browser flowThe client uses Proof Key for Code Exchange for supported authentication exchanges
PersistenceThe authenticated session is persisted in browser storage so an authorised user can resume the application
RefreshAccess tokens are refreshed automatically; the application also checks sessions when it starts and when a suspended browser tab becomes active
Expiry handlingMissing, invalid, or expired session state clears the application identity and returns the user to login
Account eligibilityAccess requires a login-eligible linked application profile; inactive or offboarded users are rejected and signed out locally
Sign-outUser sign-out clears the current browser session and authentication-related application state

Because the refresh token is stored in the browser, cross-site scripting prevention is a material session-security control. A malicious script executing in the application origin acts within the user's session even when the token value is not directly readable.

Identity and authorisation boundary

Authentication establishes who the user is; it does not by itself determine everything the user can access.

  1. Supabase Auth verifies the password and issues the signed session.
  2. The application resolves the linked user profile, tenant, account status, and assigned access context.
  3. Navigation controls limit visible application functions.
  4. Database grants, row-level security, storage policies, and trusted operation checks remain the authoritative enforcement boundary.
  5. Selected privileged server operations revalidate the authenticated actor, tenant, role, and requested object before elevated processing. Complete operation coverage is not available.

Password management

  • Password values are verified by Supabase Auth and are not stored as plaintext in the application database.
  • An authenticated password change requires verification of the current password before the managed identity password is updated.
  • Administrative user-management operations execute through trusted server controls rather than exposing privileged identity credentials to the browser.
  • A complete self-service recovery workflow is not implemented. Public self-service recovery remains unavailable until an approved support workflow, identity-verification standard, administrative authorization, session revocation step, and audit record are established.

Current security posture

ControlCurrent observation
Password authenticationActive for registered phone identities and the restricted corporate-email path
Signed sessionsActive through managed access and refresh tokens
PKCEConfigured in the browser client
Automatic refreshConfigured, with additional foreground-session validation
Account-status gateActive for application profiles
Multi-factor authenticationNot currently enforced; no enrolled factors were observed in the live read-only snapshot
Breached-password screeningManaged security advisor reports that leaked-password protection is disabled
CAPTCHA and account-level abuse controlsNot established from the available account evidence
Global session revocationNot established by the normal user sign-out flow, which clears the current browser session

Required hardening

  1. Enable breached-password screening and document the approved password policy.
  2. Introduce phishing-resistant or time-based multi-factor authentication for privileged users, then expand according to risk.
  3. Apply uniform pre-authentication failure messages, rate limits, progressive delay, and bot protection to login-context validation.
  4. Define access-token lifetime, refresh-token reuse protection, inactivity timeout, maximum session duration, concurrent-session policy, and administrator-initiated revocation.
  5. Document and test password recovery, lost-device handling, offboarding, and emergency account suspension.
  6. Revalidate sensitive operations against current server-side identity and authorisation state rather than relying only on browser-held session claims.

Authentication failure behavior

FailureUser-visible resultSecurity handling
Unknown tenant or identity associationGeneric authentication failureDo not reveal whether tenant, phone, email, or profile exists
Incorrect passwordGeneric authentication failureManaged provider applies configured rate limits; application avoids credential logging
Inactive or offboarded profileAccess is refused and local application identity is clearedCurrent profile state overrides a previously valid browser session
Expired or invalid access tokenProtected request fails and session refresh or reauthentication beginsBackend does not trust stale client state
Failed refreshUser returns to loginClear application context and avoid replaying privileged or non-idempotent operations automatically
Missing authorization after successful authenticationThe requested route or operation is deniedAuthentication success does not bypass tenant, role, ownership, row, or workflow rules
Suspicious repeated attemptsCurrent configuration provides managed rate limits; full account-level abuse controls remain an open actionIntroduce challenge, progressive delay, alerting, and incident correlation without enabling account enumeration

Hardening verification plan

The authentication control is complete only after tests cover correct and incorrect credentials, unknown tenant context, inactive profiles, session expiry, token refresh, token reuse behavior, foreground revalidation, current-session sign-out, administrator revocation, offboarding, concurrent sessions, lost-device handling, password recovery, MFA enrollment and challenge, breached-password rejection, rate limiting, CAPTCHA or bot challenge, and uniform failure messages.

Evidence basis and limitations

The description is based on application behavior, a live read-only identity and factor inventory, current managed-service security advisories, and authoritative Supabase guidance. It does not publish user counts, credentials, token values, internal account identifiers, or implementation details. Account-level password settings, CAPTCHA, rate limits, token lifetime, SMTP/SMS configuration, and administrative access logs require separate provider-account evidence.

Authoritative references