Authentication
Authentication patterns provide secure access to protected resources. This page demonstrates common login forms, multi-factor authentication, and session management patterns.
Basic Login Form
A simple username and password login form for government services.
Sign in to your account
Login with Remember Me
A login form with a checkbox to remember the user's session.
Login with Validation Errors
A login form demonstrating error states for invalid credentials.
Sign in failed
Multi-Factor Authentication (MFA)
A verification code entry form for two-factor authentication.
Verify your identity
We sent a 6-digit verification code to j***@email.gov
Login with External Identity Provider
A login page offering multiple sign-in options including external identity providers.
Sign in
Choose how you want to sign in:
Session Management
A banner showing session status with options to extend or end the session.
Session expiring: Your session will expire in 5 minutes. or sign out now.
Session Expired
Your session has expired. Please sign in again to continue.
Accessibility Considerations
When implementing authentication forms:
- Use proper
autocompleteattributes for username and password fields - Associate error messages with form fields using
aria-describedby - Use
aria-invalid="true"for fields with validation errors - Provide clear instructions for MFA code format
- Ensure form labels are properly associated with inputs
- Use
role="alert"for error messages to announce them to screen readers