# Accessible Authentication

> The Accessible Authentication WCAG success criterion requires login methods that do not depend on cognitive tests.

## What does WCAG Accessible Authentication require for login forms?

The success criterion that prohibits requiring cognitive function tests, such as remembering a password or solving a puzzle, without an alternative. Supporting password managers, copy-paste and passkeys meets the requirement.

- Topic: WCAG 2.2
- Type: concept

## Example

Wrong:

```html
<label for="pw">Password</label>
<input id="pw" type="password" onpaste="return false">
```

Right:

```html
<label for="pw">Password</label>
<input id="pw" type="password" autocomplete="current-password">
```

Blocking paste breaks password managers; `autocomplete` lets them fill the field so users do not have to recall or retype it.

## Common mistakes

- Blocking paste in the password field, which breaks password managers.
- Splitting a one-time code into separate inputs that cannot be pasted into.

## Key points

- Password and code fields allow paste and do not block password managers.
- Login fields have correct `autocomplete` values like 'username', 'current-password' and 'one-time-code'.
- A CAPTCHA based on puzzles or memory has an alternative that needs no cognitive test, such as a passkey or email link.

## Interview questions

### Is a CAPTCHA allowed under Accessible Authentication?

At level AA, object recognition and tests based on content the user supplied are allowed. Text transcription and puzzles need an alternative.

### Are one-time codes allowed in login flows?

Yes, if users can paste the code or it fills in automatically, for example with `autocomplete="one-time-code"`.

## Related cards

- [Passkeys](https://wonderium.dev/web/passkeys.md)
- [Accessible Forms](https://wonderium.dev/a11y/accessible-forms.md)
- [`<input>`](https://wonderium.dev/html/input.md)
- [Redundant Entry](https://wonderium.dev/a11y/redundant-entry.md)
- [WCAG 2.2](https://wonderium.dev/a11y/wcag-2-2.md)

---

- Level: [Accessibility](https://wonderium.dev/a11y.md)
- HTML version: https://wonderium.dev/a11y/accessible-authentication
- Last updated: 2026-11-25
