Skip to main content

Official websites use .gov
A .gov website belongs to an official government organization in the United States.

Secure .gov websites use HTTPS
A lock ( ) or https:// means you’ve safely connected to the .gov website. Share sensitive information only on official, secure websites.

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.

Sign in to your account

Login with Validation Errors

A login form demonstrating error states for invalid credentials.

Sign in to your account
Please enter a valid email address.
Password is required.

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

Enter the 6-digit code sent to your email or phone

Didn't receive a code? Resend code or use a different method

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 autocomplete attributes 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

agency.gov

An official website of the Agency

Looking for U.S. government information and services?
Visit USA.gov