Provide Accessible Alternatives or Assistance for Cognitive Function Tests in Authentication
Why It Matters
Authentication methods requiring memory (passwords), transcription (typing characters from an image/audio CAPTCHA), or puzzle-solving can be significant barriers for users with various cognitive disabilities. Providing alternatives or assistance makes login accessible.
Fixing the Issue
Offer Alternatives: Provide authentication options that don’t rely on recalling or transcribing codes, such as:
- Using third-party login providers (OAuth – e.g., “Login with Google/Facebook”).
- WebAuthn / FIDO2 (using device biometrics or security keys).
- Email link authentication (“magic links”).
- Object recognition CAPTCHAs (though these can have other issues).
Provide Assistance: If using password fields, allow copy-paste and permit use of password managers (don’t disable paste). If using CAPTCHAs requiring transcription, ensure accessible alternatives like audio CAPTCHAs (with clear audio) or alternative tests are available. Avoid complex puzzles.
Good Code Example
Allowing password pasting and offering alternative login:
-
<h2>Login</h2> <form action="/login" method="post"> <label for="username">Username:</label> <input type="text" id="username" name="user" autocomplete="username"> <br> <label for="password">Password:</label> <input type="password" id="password" name="pass" autocomplete="current-password"> <br> <button type="submit">Login</button> </form> <hr> <p>Or log in using:</p> <button onclick="loginWithGoogle()">Login with Google</button> <script> function loginWithGoogle() { /* Redirect to Google OAuth flow */ } // function loginWithWebAuthn() { /* Initiate WebAuthn flow */ } </script>
Bad Code Example
Authentication relies solely on transcribing a visual CAPTCHA with no accessible alternative:
-
<form action="/login" method="post"> <label for="captcha">Enter the text from the image:</label> <img src="/captcha-image.php" alt="CAPTCHA image"> <input type="text" id="captcha" name="captcha_code"> <br> <button type="submit">Login</button> </form>
