medium complexity extracted Authentication & Access Control Confidence: 100%
8
Components
106
Shared
0
User Stories
Yes
Analyzed

Description

Provides the foundational authentication mechanism allowing users to register and sign in using an email address and password. This is the baseline login method required for MVP launch across all user roles. The system issues JWT access and refresh tokens upon successful authentication, which are stored securely on-device using platform keychain or keystore mechanisms. Password policies enforce minimum security standards, and the flow supports password reset via email.

User Flow

Email & Password Login user flow
Click to expand

Analysis

Business Value

Email and password login is the universal fallback authentication method that ensures every user can access the platform regardless of whether they have BankID or Vipps. Without this, MVP launch would be blocked entirely since BankID and Vipps are Phase 2 features. It also serves as the admin portal authentication method for coordinators and org admins who primarily use desktop browsers. Providing a reliable, low-friction baseline login builds trust with early adopters and allows the platform to onboard users during the pilot phase without depending on third-party identity providers.

Implementation Notes

Implemented via a REST API endpoint on the Next.js backend using bcrypt for password hashing and JWT for token issuance. The Flutter client stores access and refresh tokens in the platform keychain (iOS Keychain via flutter_secure_storage, Android Keystore). Token refresh logic runs silently in the background using an HTTP interceptor (Dio). The admin portal uses HTTP-only cookies for session management instead of localStorage. Password reset uses a time-limited signed token sent via email. Rate limiting and brute-force protection must be applied at the API layer. The auth flow uses a BLoC for state management in the mobile app.

Components (114)

User Interface (4)

Service Layer (2)

Data Layer (1)

Infrastructure (1)

Shared Components

These components are reused across multiple features

Service Layer (34)

Data Layer (22)

Infrastructure (38)

infrastructure Keychain/Keystore Adapter low Shared infrastructure JWT Claims Extractor low Shared infrastructure Organization Labels Adapter low Shared infrastructure Keychain/Keystore Adapter low Shared infrastructure Auth API Client medium Shared infrastructure REST API Client medium Shared infrastructure WCAG Accessibility Adapter low Shared infrastructure Registration API Client low Shared infrastructure Accounting API Client high Shared infrastructure PDF Renderer Adapter medium Shared infrastructure File Share Adapter low Shared infrastructure FCM/APNs Adapter high Shared infrastructure Share Sheet Adapter low Shared infrastructure Share Plus Adapter low Shared infrastructure Platform Accessibility Bridge medium Shared infrastructure Semantics Override Adapter high Shared infrastructure URL Launcher Adapter low Shared infrastructure Markdown Content Renderer low Shared infrastructure Network Connectivity Monitor low Shared infrastructure Expense Receipt Storage Adapter low Shared infrastructure Audit Log Writer low Shared infrastructure Feature Flag Checker low Shared infrastructure Logo Upload Adapter low Shared infrastructure Terminology Constants Registry low Shared infrastructure Feature Flag Cache Adapter low Shared infrastructure Org Scope JWT Resolver medium Shared infrastructure Association Audit Logger low Shared infrastructure Token Blocklist medium Shared infrastructure Analytics Tracker low Shared infrastructure SEO Metadata Config low Shared infrastructure Analytics Tracker low Shared infrastructure Analytics Tracker low Shared infrastructure Sales Analytics Tracker low Shared infrastructure Email Provider Adapter low Shared infrastructure Terms of Service Content Provider low Shared infrastructure Legal PDF Asset Provider low Shared infrastructure Consent-Gated Script Loader low Shared infrastructure Legal Page Layout low Shared

User Stories

No user stories have been generated for this feature yet.