Skip to content

Authentication & Authorization - Product Requirements Document

Version: 2.0 | Status: Business Review | Date: 2026-01-15 Previous Version: 1.0 (Technical Draft) | Author: Product Team


Change Log

VersionDateChanges
2.02026-01-15Converted to business-focused format; added measurable outcomes and success metrics
1.02026-01-09Initial technical draft

1. Executive Summary

1.1 Purpose

Enable secure, passwordless access to Toprent.app through magic link authentication, enforcing role-based permissions across all user types. Users authenticate once and access multiple rental companies with appropriate permissions per company.

1.2 Business Value

Value AreaMeasurable OutcomeTimeframe
Support Cost ReductionReduce password-related support tickets by 80% (industry: 20-50% of help desk volume is password resets)Within 6 months
User ActivationIncrease first-login completion rate from ~70% to 90%+ with frictionless magic linksWithin 3 months
Security IncidentsZero unauthorized access incidents through passwordless + optional MFAOngoing
Multi-Business EfficiencyEnable users managing multiple companies to switch contexts in <3 seconds vs. logging out/inImmediate
Compliance ReadinessMFA capability meets financial data security requirements without mandating enrollmentImmediate

1.3 Target Users

User TypeBusiness Context
Company AdministratorsFull system access, user management, billing, financial data
Company OperatorsDay-to-day operations: reservations, customer management, vehicles
Vehicle PartnersLimited access to their vehicles, calendar, and offer calculator
Drivers (Couriers/Staff)View-only access to assigned reservations and delivery tasks

1.4 Scope

Included:

  • Passwordless magic link authentication
  • Optional SMS-based multi-factor authentication
  • Four-role permission system (Admin, Operator, Partner, Driver)
  • Multi-company user access with per-company roles
  • Seamless company switching without re-login
  • Permission-based UI visibility controls
  • Session management with automatic refresh

Excluded:

  • Password-based authentication (legacy, being phased out)
  • TOTP/authenticator app MFA (future consideration)
  • Third-party SSO (OAuth, SAML)
  • Biometric authentication
  • Self-service user registration (separate feature)

Note: Password reset and change password remain active for legacy users during transition.


2. Success Metrics

MetricDefinitionBaselineTargetMeasurement Method
Password Ticket ReductionMonthly support tickets for password issuesTo be measured80% reduction within 6 monthsHelp desk ticket categorization
Magic Link Delivery Rate% of magic links delivered within 5 secondsN/A (new)>99%Email delivery logs
First-Login Completion% of invited users completing sign-in within 24 hours~70% (est.)>90%User analytics
MFA Adoption Rate% of Admin users enabling MFAN/A (new)50% within 12 monthsUser settings analytics
Session Continuity% of active sessions maintained without interruptionN/A (new)>99.5%Session refresh logs
Company Switch TimeAverage time to switch between companiesN/A (new)<3 secondsPerformance monitoring
Unauthorized Access IncidentsSecurity incidents from authentication failures00 (maintain)Security audit logs
Authentication Success Rate% of sign-in attempts completing successfullyN/A (new)>98%Authentication analytics
Role Permission ViolationsAPI requests blocked due to insufficient permissionsN/A (new)Track & monitorAPI access logs

3. User Stories

Administrators (P0 - Critical)

IDStoryAcceptance Criteria
US-01As an Admin, I want to sign in via magic link so I don’t need to remember passwordsGiven I enter my email, when I submit, then I receive a sign-in link within 5 seconds; clicking it authenticates me
US-02As an Admin, I want to select which company to access after signing in so I can manage multiple businessesGiven I have access to multiple companies, when I authenticate, then I see all my companies with my role for each
US-03As an Admin, I want to switch companies without logging out so I work efficiently across businessesGiven I’m authenticated, when I select another company from the menu, then I switch contexts in <3 seconds
US-04As an Admin, I want my session to remain active while working so I don’t re-authenticate repeatedlyGiven I’m active, when my session approaches expiration, then it refreshes automatically without interruption

Administrators (P1 - Important)

IDStoryAcceptance Criteria
US-05As an Admin, I want to enable MFA so financial data has additional protectionGiven I enable MFA, when I sign in, then I must enter SMS code before accessing the system
US-06As an Admin, I want to create users with specific roles so I control feature accessGiven I create a user, when I assign a role, then they see only permitted features
US-07As an Admin, I want to customize permissions per user so I can fine-tune access beyond default rolesGiven I edit user permissions, when I disable calendar access, then that user cannot see calendar features
US-08As an Admin, I want to view authentication audit logs so I can monitor account securityGiven suspicious activity, when I view logs, then I see all sign-in events with timestamps and outcomes

Operators (P0 - Critical)

IDStoryAcceptance Criteria
US-09As an Operator, I want to sign in quickly via magic link so I can process reservationsGiven I click my magic link, when I authenticate, then I land on my working dashboard in <10 seconds total
US-10As an Operator, I want to see only features I’m permitted to use so the interface isn’t clutteredGiven my role permissions, when I view navigation, then inaccessible features are hidden

Operators (P1 - Important)

IDStoryAcceptance Criteria
US-11As an Operator, I want to switch between companies I work for without logging outGiven I work for multiple companies, when I switch, then I see that company’s data immediately
US-12As an Operator, I want the system to remember my last company so I save time on subsequent loginsGiven I have a preferred company, when I sign in, then my last-used company is pre-selected

Partners (P0 - Critical)

IDStoryAcceptance Criteria
US-13As a Partner, I want to sign in and see my vehicle calendar immediatelyGiven I authenticate, when I land, then my calendar view loads showing only my vehicles

Partners (P1 - Important)

IDStoryAcceptance Criteria
US-14As a Partner, I want access to the calculator to view offers for my vehiclesGiven I have calculator permission, when I access it, then I see offers relevant to my fleet
US-15As a Partner, I want restricted access so I only see my own vehiclesGiven I view vehicles, when results load, then only vehicles I own are visible

Drivers (P0 - Critical)

IDStoryAcceptance Criteria
US-16As a Driver, I want to sign in and see only my assigned reservationsGiven I authenticate, when I land, then only my delivery tasks are visible
US-17As a Driver, I want view-only access so I can’t accidentally modify bookingsGiven I view a reservation, when I attempt edits, then modification controls are hidden/disabled

All Users (P0 - Critical)

IDStoryAcceptance Criteria
US-18As any user, I want magic links to expire for security if compromisedGiven a magic link, when 60 minutes pass, then it no longer works
US-19As any user, I want my session to auto-refresh so I stay signed in during workGiven I’m active, when tokens approach expiration, then refresh happens invisibly
US-20As any multi-company user, I want to see all my companies after authenticationGiven I have multiple company access, when I sign in, then all companies display with my role for each

All Users (P1 - Important)

IDStoryAcceptance Criteria
US-21As any user, I want clear error messages if authentication failsGiven a failure, when I see the error, then I understand how to resolve it
US-22As any user, I want to cancel MFA verification to try a different accountGiven I’m in MFA flow, when I cancel, then I return to sign-in with state cleared

4. Functional Requirements

IDRequirementPriorityBusiness Rationale
FR-01Magic links must be delivered within 5 seconds and expire after 60 minutesP0Balances user convenience with security
FR-02System must protect against email enumeration (always return success message)P0Security best practice; prevents account discovery attacks
FR-03Users can belong to multiple companies with different roles per companyP0Supports consultants, franchise operators, multi-location businesses
FR-04Company selection appears after authentication showing all accessible companies with rolesP0Multi-tenant user experience requirement
FR-05Company switching must complete without re-authenticationP0Efficiency for multi-business users
FR-06System enforces four roles: Administrator, Operator, Partner, DriverP0Clear permission boundaries
FR-07Role permissions enforced at both UI (hidden components) and API (blocked requests) levelsP0Defense in depth; prevents bypass via direct API calls
FR-08SMS verification codes (6 digits) must deliver within 10 seconds and expire after 5 minutesP1MFA user experience balance
FR-09MFA attempts must be rate-limited to prevent brute force attacksP1Security requirement
FR-10SMS resend allowed after 30-second cooldown with maximum 5 resends per sessionP1Anti-abuse while allowing recovery
FR-11Session tokens valid for 30 days with automatic refresh before expirationP0Continuous work sessions without interruption
FR-12Sessions scoped to specific company contextP0Multi-tenant data isolation
FR-13Admins can customize user permissions beyond default rolesP1Fine-grained access control (calendar, offers, billing, contacts visibility)
FR-14All authentication events logged to audit trailP1Security compliance and monitoring
FR-15Users routed to role-appropriate landing pages after authenticationP1Driver→reservations, Partner→calendar, Admin/Operator→dashboard
FR-16System auto-selects company if user has only oneP0Streamlined experience for single-company users
FR-17ADMIN role company preferred for auto-selection when multiple existP1Prioritizes highest-privilege context
FR-18Non-ADMIN users can leave companies they belong toP1Self-service access management
FR-19Sign-out clears all authentication state and redirects to sign-inP0Security requirement

5. Business Rules

IDRuleBusiness Rationale
BR-01Magic links can only be used oncePrevents replay attacks
BR-02One role per user per companySimplifies permission logic; clear accountability
BR-03ADMIN role has unrestricted access within their companyBusiness requirement for full control
BR-04Partners can only view vehicles they ownPrivacy and competitive protection
BR-05Drivers have read-only access to reservationsPrevents accidental modifications
BR-06MFA enrollment is optional, not enforcedBalances security with user choice
BR-07MFA phone must be verified before enablingPrevents lockout from typos
BR-08Custom permissions override default role permissionsEnables exceptions without creating new roles
BR-09Users removed from a company persist if they have other company accessData preservation for multi-company users
BR-10ADMINs cannot leave their own companyPrevents ownership orphaning
BR-11Authentication errors return generic messagesPrevents information leakage
BR-12Public pages (sign-in, confirmation) bypass authenticationUser experience requirement

6. Acceptance Criteria

Given a user with an existing account
When they enter their email and submit
Then they receive a magic link within 5 seconds
And clicking the link authenticates them
And the link expires after 60 minutes
And the link works only once

AC-02: Email Enumeration Protection

Given a user enters an email that doesn’t exist
When they submit the sign-in form
Then the system returns a success message
And no email is sent
And behavior is indistinguishable from valid email submission

AC-03: Multi-Company Selection

Given a user with access to multiple companies
When they complete authentication
Then they see all associated companies with their role for each
And they can select which company to access
And single-company users skip selection automatically

AC-04: Company Switching

Given a user authenticated to a specific company
When they select another company from the profile menu
Then they switch to that company in <3 seconds
And no re-authentication is required
And they land on the role-appropriate page for the new company

AC-05: MFA Verification

Given a user with MFA enabled
When they complete initial authentication
Then they receive a 6-digit SMS code within 10 seconds
And entering correct code within 5 minutes completes authentication
And incorrect codes show clear error with retry option
And cancel returns them to sign-in with state cleared

AC-06: Role-Based Access (Driver)

Given an authenticated user with Driver role
When they access the application
Then they see only the reservations page
And other navigation items are hidden
And API requests to restricted resources return forbidden errors

AC-07: Role-Based Access (Partner)

Given an authenticated user with Partner role
When they access the application
Then they see calendar and calculator pages
And they only view vehicles they own
And they cannot create or modify reservations

AC-08: Role-Based Access (Operator)

Given an authenticated user with Operator role
When they access the application
Then they can create reservations, manage customers, and view vehicles
And they cannot access billing, admin statistics, or user management

AC-09: Role-Based Access (Administrator)

Given an authenticated user with Administrator role
When they access the application
Then they have unrestricted access to all features
And they can create users with any role
And they can modify system settings

AC-10: Session Continuity

Given an authenticated user
When their session approaches expiration during active work
Then the token refreshes automatically
And the user experiences no interruption

AC-11: Sign-Out Security

Given an authenticated user
When they sign out
Then all session data is cleared
And they are redirected to sign-in
And subsequent API requests return unauthorized errors


7. Dependencies

7.1 Depends On

  • 01-Multi-Tenant Architecture: User-company associations and per-company role assignments

7.2 Depended By

All user-facing features require authentication:

  • Reservations Management
  • Vehicle Fleet Management
  • Customer Management
  • Billing & Invoicing
  • Marketplace Features
  • Reports & Analytics

7.3 External Services

  • Email delivery system (magic link sending)
  • SMS provider (MFA codes)
  • reCAPTCHA (bot protection for MFA)

8. Glossary

TermBusiness Definition
Magic LinkSingle-use URL sent via email that authenticates user without password
MFA (Multi-Factor Authentication)Additional SMS verification step for enhanced account security
RoleUser’s permission level within a company (Administrator, Operator, Partner, Driver)
Permission GateFeature visibility control based on user’s role permissions
SessionPeriod of authenticated access, maintained across browser sessions
Company SwitchingChanging active company context without re-authenticating
Custom PermissionUser-specific access override (e.g., calendar access, billing visibility)
Driver/Courier/StaffInterchangeable terms for delivery personnel role

9. Approval

RoleNameDateStatus
Product OwnerPending
Engineering LeadPending
Security ReviewPending
Business StakeholderPending

10. Unresolved Questions

  1. Password phase-out timeline? When to fully deprecate password login?
  2. MFA enforcement policy? Should MFA be mandatory for ADMIN role accessing financial data?
  3. Session duration by role? Should Drivers have shorter sessions than Admins for security?
  4. TOTP MFA priority? When to add authenticator app option vs. SMS-only?
  5. SSO roadmap? Enterprise customer demand for OAuth/SAML integration?