Skip to main content

FR-01 — IAM Implementation Plan

Introduction

The FR-01 Implementation Plan defines the development sequence for delivering SalesFam Authentication, Identity & Access Management. It translates the approved FR-01 requirements and technical design into implementation tasks covering the IAM foundation, registration and verification, onboarding, authentication, session management, password recovery, and access control.

Implementation Scope

The implementation covers:

  • IAM foundation and data models
  • Account registration and verification
  • Account-type selection and onboarding
  • Login, logout, and session refresh
  • Password recovery and reset
  • Role-based access control
  • Account-status enforcement
  • IAM integration and testing

Completion

FR-01 is considered complete when the defined IAM flows are implemented, integrated, secured, and verified against the acceptance criteria established in the Functional Requirements.

1. Implementation Order

The order is intentional: lower-level foundations are built before the features that depend on them.

2. Implementation Tasks

IDTaskDepends On
IAM-IMP-01Set up IAM module structure and shared configuration
IAM-IMP-02Implement IAM database models and relationshipsIAM-IMP-01
IAM-IMP-03Implement input validation and standard API errorsIAM-IMP-01
IAM-IMP-04Implement verification-code generation, storage, expiration, and resend rulesIAM-IMP-02
IAM-IMP-05Implement account registrationIAM-IMP-02, IAM-IMP-03, IAM-IMP-04
IAM-IMP-06Implement email verificationIAM-IMP-04, IAM-IMP-05
IAM-IMP-07Implement account-type selectionIAM-IMP-06
IAM-IMP-08Implement Company onboardingIAM-IMP-07
IAM-IMP-09Implement Sales Representative onboardingIAM-IMP-07
IAM-IMP-10Implement login and authenticated session creationIAM-IMP-02, IAM-IMP-03
IAM-IMP-11Implement session refreshIAM-IMP-10
IAM-IMP-12Implement logout and session revocationIAM-IMP-10
IAM-IMP-13Implement forgot-password flowIAM-IMP-02
IAM-IMP-14Implement reset-password flowIAM-IMP-13
IAM-IMP-15Implement authentication middlewareIAM-IMP-10
IAM-IMP-16Implement RBAC and account-status checksIAM-IMP-15
IAM-IMP-17Apply resource-access protection to IAM endpointsIAM-IMP-16
IAM-IMP-18Test complete IAM flows and edge casesAll above

3. Implementation Sequence

Phase A — Foundation

Complete: IAM-IMP-01IAM-IMP-03. This establishes the module structure, database access, validation, and common error handling.

Phase B — Registration & Verification

Complete: IAM-IMP-04IAM-IMP-06. Flow: Register → Verification Code → Verify Email.

Phase C — Onboarding

Complete: IAM-IMP-07IAM-IMP-09. Flow: Verified User → Choose Account Type → Company Onboarding / Rep Onboarding.

Phase D — Authentication & Sessions

Complete: IAM-IMP-10IAM-IMP-12. Flow: Login → Session → Refresh / Logout.

Phase E — Password Recovery

Complete: IAM-IMP-13IAM-IMP-14. Flow: Forgot Password → Reset Password.

Phase F — Authorization

Complete: IAM-IMP-15IAM-IMP-17. This establishes the protection layer required by the rest of SalesFam: Request → Authentication → Account Status → Role / Permission → Resource Access → Operation.

Phase G — Verification

Complete: IAM-IMP-18. Test the complete lifecycle rather than testing endpoints only in isolation.

4. FR-01 Completion Criteria

FR-01 is complete when:

  • A user can register and verify their account.
  • A verified user can select Company or Rep.
  • The selected onboarding flow can be completed.
  • Users can log in and maintain a valid session.
  • Users can refresh and terminate sessions.
  • Users can recover and reset their password.
  • Protected endpoints enforce authentication.
  • Role-based access is enforced server-side.
  • Account status restrictions are enforced.
  • Users cannot access another user's protected resources.
  • The complete IAM flow passes integration testing.