One weak help-center article about a security task, audited, split into pages by purpose, migrated to MDX, versioned in Git, checked with Vale, published with Docusaurus, tested for translation, and revised. Every stage is a real commit, and every output is here to inspect.
The article is original, made for this case study in the shape of a Zendesk Guide article. It isn’t an export from an employer. The product is Keycloak 26.8.2, running on my own computer with test users, so every claim can be checked. Not official Keycloak documentation, and not work done for any company. This independent portfolio demonstration was developed with AI assistance under my direction. Source files, validation results and known limitations are available for inspection.
1Source
The starting point: a short article as many help centers hold them, written once and never reviewed.
Help CenterLogin issues
How to reset 2FA
Title not in Title Case
Sometimes users lose their phone and can’t login anymore. This is a piece of cake to fix!
Steps:
1. Login to Keycloak and go to users.
2. Find the user and click on credentials tab.
3. Simply delete the OTP and the user will be asked to setup 2FA again on their next login.
14 findings: the quote, the problem, the fix. Two are critical, and neither is a matter of style.
A1CriticalAccuracy
Simply delete the OTP and the user will be asked to setup 2FA again on their next login.
Problem. False in Keycloak 26.8.2. With the default browser flow, a user whose OTP credential was deleted signs in with the password alone, and nothing asks them to set up a new authenticator. The account is left with one factor. Evidence: evidence.json, step signin-without-required-action: otp_prompt false.
Fix. The how-to adds the step that was missing: Configure OTP in Required user actions, then Save. A caution says why the step matters.
A2CriticalSecurity
Sometimes users lose their phone and can’t login anymore.
Problem. Nothing asks the administrator to confirm that the request comes from the account’s owner. A reset on a request from someone else hands them the account.
Fix. A shared Before you start section, reused by the how-to and the troubleshooting page, asks for confirmation through contact details given before the phone was lost.
The other 12 findings: terminology, structure, accessibility, localization, governance
A3MajorTerminology
2FA … OTP … MFA settings
Problem. Three names for one thing, none of them defined. Keycloak’s console calls it OTP: the credential type is Otp and the required action is Configure OTP. A translator, a search engine and a reader each see three subjects.
Fix. One term, one-time password (OTP), defined once on the concept page and recorded in the terminology list for translation.
A4MajorAccuracy
go to users … click on credentials tab
Problem. The labels don’t match the interface (Users, Credentials), and the steps skip the realm: an administrator of the master realm searches the wrong realm’s users.
Fix. Interface labels in bold, exactly as the console shows them, and a first step that checks the current realm.
A5MajorStructure
<p><strong>Steps:</strong></p> <p>1. Login to Keycloak …
Problem. Bold text in place of a heading, and step numbers typed into paragraphs. Screen readers and the help center’s own table of contents see no structure, and one task is mixed with background and settings.
Fix. Real headings and an ordered list, and the content split by purpose: a concept, a how-to, a reference and a troubleshooting page.
A6MajorCompleteness
(no check that the reset worked)
Problem. The reader can’t tell success from failure, and nothing records what was done.
Fix. A Check that it worked section: the new Otp row, its date, and the admin events Keycloak keeps.
A7MajorTroubleshooting
If it still doesn’t work please contact IT.
Problem. No symptom, no cause, no action, and the reader is often IT.
Fix. A troubleshooting page organised by what the user sees, each with its cause and the fix, reproduced on the server.
A8MajorAccessibility
<img src="/hc/article_attachments/900000000201">
Problem. No alternative text and no caption. A reader who can’t see the picture loses its content, and nobody can tell which step it belongs to.
Fix. Each screenshot has alternative text that says what is marked, sits under the step it shows, and has its sensitive values hidden.
A9MinorAccessibility
You can change the MFA settings <a …>here</a>
Problem. "here" says nothing out of context, and screen-reader users often move from link to link.
Fix. Link text that names the destination: Keycloak OTP policy.
A10MajorLocalization
a piece of cake … secs … Last updated 3/4/25
Problem. An idiom that doesn’t translate, an abbreviation, an exclamation, and a date that means 3 April in France and 4 March in the US.
Fix. Plain wording, units in full, and dates kept by the publishing system in ISO 8601, so each locale can show its own format.
A11MinorGrammar
can’t login … Login to Keycloak … setup 2FA
Problem. Login and setup are nouns. The verbs are sign in and set up.
Fix. Sign in and set up as verbs, everywhere, enforced by a Vale substitution rule.
A12MajorGovernance
label_names: mfa, keycloak, login issues
Problem. No owner, no reviewer, no review date, no product version and no audience. Nobody knows when the article stops being true, and it says nothing about the Keycloak version it describes.
Fix. Front matter on every page: owner, audience, product version, last review and review interval. The Git history records every change and who approved it.
A13MinorAudience
Sometimes users lose their phone
Problem. It opens with the user’s problem, but every step is an administrator’s. A user who finds it can do none of it.
Fix. The how-to says who it’s for in its first lines. The user’s side, setting up the new phone, is one step with its own screenshot.
A14MinorTone
Simply delete …
Problem. Simply tells a reader who is stuck that the task is easy. Here it also hides the step that makes the reset safe.
Fix. No minimisers; Vale flags simply, just and easily.
3Information Architecture
The article mixed a user’s problem, an administrator’s task, a setting and a dead end. Each becomes a page with one purpose, so a reader lands on what they came for and each page can be reviewed on its own.
Each page is an MDX file: Markdown with components. The front matter carries what the audit found missing; a partial holds the identity check once for two pages; a Screenshot component gives every picture its alternative text, caption and size. One sentence per line, so a diff shows exactly which sentence changed.
site/docs/how-to/reset-otp.mdx, the first steps
---
title: Reset a User's OTP Credential
description: Delete a lost authenticator's OTP credential in Keycloak, and make the user set up a new one at their next sign-in.
doc_type: How-to
audience: Keycloak administrators
product_version: Keycloak 26.8.2
owner: Karan Deshmukh
last_review: 2026-11-28
---
import PageFacts from '@site/src/components/PageFacts';
import Screenshot from '@site/src/components/Screenshot';
import ConfirmIdentity from '../_partials/_confirm-identity.mdx';
# Reset a User's OTP Credential
<PageFacts />
When a user loses or replaces the phone that holds their authenticator app, sign the user out, delete the phone's one-time password (OTP) credential, and make the user set up a new one at their next sign-in.
This procedure resets the OTP credential only.
It doesn't remove passkeys, security keys or other second factors that the user may also have.
## Before You Start {#before-you-start}
<ConfirmIdentity />
- Sign in to the admin console with an account that can manage the users of the user's realm.
- Have the user's username or email address.
- Make sure that the user has the new phone, with an authenticator app such as FreeOTP, Google Authenticator, or Microsoft Authenticator.
- Check that the realm uses Keycloak's default browser flow, in which the OTP step is conditional.
With a custom flow, Keycloak may ask for a code at a different point, or not at all.
## Steps {#steps}
:::important Do the steps in this order
1. Sign the user out first: an open session reaches **Mobile Authenticator Setup** without asking for the password.
2. Add the required action before you delete the credential: in the other order, the user can sign in with the password alone in between.
Both behaviors were tested on Keycloak 26.8.2.
:::
1. In the admin console, check that the user's realm is the current realm: its name is at the top of the menu.
Select **Users**, search for the user, and then select their username.
<Screenshotsrc="/img/keycloak/01-find-user.png"alt="The Users page of the admin console. The search box is outlined in green, and the username alex.morgan is outlined and marked 1."caption="Step 1. Search for the user, and then select their username." />
2. On the **Sessions** tab, select **Logout all sessions**, and then select **Confirm**.
The dialog says that it signs out "active subjects in this realm."
On a user's **Sessions** tab, it signs out that user only. In a test with a second user, the second user's session stayed open.
<Screenshotsrc="/img/keycloak/00-sessions.png"alt="The Sessions tab of alex.morgan, marked 1, with one open session in the list. The Logout all sessions button is outlined and marked 2."caption="Step 2. Sign the user out of every open session." />
# "period" is the OTP policy’s term for how long a code lasts. alex flags every use as possible profanity.
alex.ProfanityUnlikely = NO
site/docs/concepts/one-time-passwords.mdx
In Keycloak 26.8.2, that step is the subflow **Browser - Conditional 2FA**, and
So when an administrator deletes a user’s OTP credential, nothing asks for a code at the next sign-in, and nothing asks the user to set up a new authenticator.
The user signs in with their password alone, until the **Configure OTP** required action is added.
The user signs in with their password alone, until an administrator adds the **Configure OTP** required action.
:::caution
site/docs/index.mdx
import PageFacts from '@site/src/components/PageFacts';
These pages explain one administrator task in Keycloak from every side: resetting a user’s one-time password (OTP) when they lose their phone.
They were migrated from a single help-center article, and split by what the reader needs.
They come from a single help-center article, split by what the reader needs.
| If you need to | Read |
They were migrated from a single help-center article, and split by what the read
| Understand what an OTP credential and a required action are | [One-time passwords in Keycloak](./concepts/one-time-passwords.mdx) |
| Reset a user’s OTP after they lose their phone | [Reset a user’s one-time password](./how-to/reset-otp.mdx) |
| Check the realm’s code length, period and other settings | [OTP policy settings](./reference/otp-policy.mdx) |
| Check the realm’s code length, period, and other settings | [OTP policy settings](./reference/otp-policy.mdx) |
| Help a user whose code doesn’t work | [When a user can’t sign in with a one-time password](./troubleshooting/otp-sign-in.mdx) |
:::note Independent documentation
Karan Deshmukh wrote these pages as a portfolio demonstration and checked every step on a Keycloak 26.8.2 server running on his own computer, with a test realm and test users.
Karan Deshmukh wrote these pages as a portfolio demonstration and checked every step on a local Keycloak 26.8.2 server.
The server held a test realm and test users only.
They aren’t official Keycloak documentation.
:::
site/docs/troubleshooting/otp-sign-in.mdx
With the default look around window of 1, Keycloak also accepts the code of the
1. Ask the user to type the code that the app shows now, before its timer runs out.
2. If every code fails, ask the user to set the phone’s date and time to update automatically.
An authenticator computes each code from the time, so a phone that is a minute off produces codes Keycloak refuses.
An authenticator computes each code from the time, so a phone that’s a minute off produces codes Keycloak refuses.
3. If many users' codes fail, check the server’s clock before you widen the look around window in the [OTP policy](../reference/otp-policy.mdx#settings).
A wider window accepts older codes, for everyone.
With the default look around window of 1, Keycloak also accepts the code of the
<ConfirmIdentity />
Delete the user’s OTP credential and make them set up a new one: [Reset a user’s one-time password](../how-to/reset-otp.mdx).
Delete the user’s OTP credential and make them set up a new one, as [Reset a user’s one-time password](../how-to/reset-otp.mdx) describes.
## Keycloak doesn’t ask for a code {#no-code-asked}
Stage 6: Translatable Labels
site/src/components/PageFacts.jsx
import React from "react";
import { useDoc } from "@docusaurus/plugin-content-docs/client";
import { translate } from "@docusaurus/Translate";
import styles from "./PageFacts.module.css";
export default function PageFacts() {
// YAML reads a bare date such as 2026-11-28 as a Date; show it as written, in ISO 8601, for every locale.
const day = (v) => (v instanceof Date ? v.toISOString().slice(0, 10) : v);
// Each label is a literal translate() call, so `docusaurus write-translations` can extract it for translators.
// Stage 6 of the case study found these labels hard-coded in English.
const rows = [
["Type", f.doc_type],
["For", f.audience],
["Checked against", f.product_version],
["Owner", f.owner],
["Last review", day(f.last_review)],
[translate({ id: "pageFacts.type", message: "Type", description: "Label: the kind of page (concept, how-to, reference)" }), f.doc_type],
[translate({ id: "pageFacts.audience", message: "For", description: "Label: who the page is written for" }), f.audience],
[translate({ id: "pageFacts.version", message: "Checked against", description: "Label: the product version the steps were checked on" }), f.product_version],
[translate({ id: "pageFacts.owner", message: "Owner", description: "Label: the person responsible for the page" }), f.owner],
[translate({ id: "pageFacts.review", message: "Last review", description: "Label: the date of the page’s last review" }), day(f.last_review)],
].filter(([, v]) => v);
return (
Stage 7: The REST Revision
site/docs/how-to/reset-otp.mdx
audience: Keycloak administrators
product_version: Keycloak 26.8.2
owner: Karan Deshmukh
last_review: 2026-11-28
last_review: 2026-11-27
---
When the realm saves admin events, **Events** > **Admin events** lists the delet
<Screenshot src="/img/keycloak/12-admin-events.png" alt="Admin events, with the ACTION on the user’s credential marked" caption="The record of the reset, for an audit." />
## Reset many users with the admin REST API {#rest-api}
After a change to the [OTP policy](../reference/otp-policy.mdx#before-change), every user’s authenticator needs a reset, and the admin console does one user at a time.
The admin REST API does the same two things: it deletes the OTP credential, and it adds **Configure OTP** to the user’s required actions.
<ConfirmIdentity />
Set these variables first.
Read the password from a password manager or a prompt, so that it stays out of your shell history.
```bash title="Variables"
KC_URL=https://keycloak.example.com # your Keycloak server
REALM=portfolio-demo # the user’s realm
KC_ADMIN=sam.rivera # an administrator of the master realm
USERNAME=alex.morgan # the user to reset
read -rs -p "Password for $KC_ADMIN: " KC_ADMIN_PASSWORD; echo
```
1. Get an access token for the admin REST API, and find the user’s ID.
At their next sign-in, Keycloak runs the user’s required actions one after another, and asks them to set up an authenticator before they get in.
## Next steps {#next-steps}
site/docs/reference/otp-policy.mdx
audience: Keycloak administrators
product_version: Keycloak 26.8.2
owner: Karan Deshmukh
last_review: 2026-11-28
last_review: 2026-11-27
---
A change applies only to authenticators set up after it.
Each OTP credential keeps the type, digits, period and algorithm it was set up with: after a change from 6 to 8 digits, a phone set up before the change still signed in with 6-digit codes.
To move a user to the new policy, [reset their one-time password](../how-to/reset-otp.mdx).
To move many users, [reset them with the admin REST API](../how-to/reset-otp.mdx#rest-api).
6Editorial Review
The checklist I review a page against before it goes out. Nobody else reviewed these pages: this is self-review, done in the open, and each line says where to see the result.
Every factual claim checked against the product Against Keycloak 26.8.2's recorded behaviour (A1), and the REST steps run as written.
Audience and purpose stated at the top of each page Front matter: type, audience, version, owner, review date.
One action per step, in the order of the screens Six steps in the console; four in the REST method.
Interface labels exactly as shown Bold, with Keycloak’s capitals, including Otp.
A result the reader can check Check that it worked: the new Otp row and the admin events.
Risks before the step that causes them The identity check comes first; the caution sits under step 4.
Links that say where they go Vale rule Portfolio.LinkText.
Pictures with alternative text and a caption 12 of 12 screenshots.
Terms consistent with the terminology list Vale rules Portfolio.Terms and Portfolio.Verbs: 0 errors.
Nothing confidential in pictures or examples The QR code and the secret key are hidden; the realm and users are test data.
An AI-assisted Draft, Corrected
An AI-assisted draft, and the human review that corrected it. The draft was produced on 27 November 2026 by Claude (Anthropic), the AI assistant that helped build this portfolio, from the source article alone and the prompt below, with no access to the Keycloak server or its recorded evidence. The review then checked each claim against the server’s recorded behaviour, before anything was published.
The AI draft
# Reset two-factor authentication (2FA) for a userIf a user loses access to their authenticator app, an administrator can reset their 2FA.1. Log in to the Keycloak Admin Console.2. Go to **Users** and search for the user.3. Open the **Credentials** tab.4. Delete the OTP credential.5. The user will be prompted to configure 2FA again the next time they log in.Note: OTP codes are valid for 30 seconds.
FalseLine 7
The user will be prompted to configure 2FA again the next time they log in.
Keycloak 26.8.2's recorded behaviour: after the deletion, the user signed in with the password alone (evidence.json, signin-without-required-action, otp_prompt false).
Fix. Add the step that was missing: Configure OTP in Required user actions, then Save, with a caution that says why.
IncompleteLine 3
Log in to the Keycloak Admin Console.
An administrator of the master realm lands in the master realm, not the user’s.
Fix. Sign in, and check that the user’s realm is the current realm before searching.
Missing a safeguardLine 2
an administrator can reset their 2FA
Nothing asks who is making the request. A reset for someone else hands them the account.
Fix. Confirm the request through contact details the user gave before they lost the phone.
True by default onlyLine 8
OTP codes are valid for 30 seconds.
30 seconds is the default period of a new realm’s OTP policy; a realm can change it, and the default look around window also accepts the previous and next code.
Fix. Moved to the OTP policy reference, as a default, with the look around window.
TerminologyLine 1
Reset two-factor authentication (2FA)
Keycloak’s console calls it OTP: the credential type is Otp and the required action is Configure OTP.
Fix. One-time password (OTP), the term on the screens the reader will use.
The AI draft read better than the source and was as wrong: it fixed the tone and kept the error. Vale flagged four things in step 5, all of them wording; none of them the false claim. Each factual claim went to the server’s recorded behaviour before publication.
The first migration had more findings than the article because it had about twenty times as much text, and the terminology page lists the forbidden words on purpose. Every finding was accepted or rejected with a reason: the decision record. Interface labels and Keycloak’s own messages are quoted, not written, so they’re out of scope; alex’s warning on the word period is off.
Vale didn’t find either critical problem of the original article. A linter checks words, not facts.
8Publication
Docusaurus 3.10.2 builds the pages: sidebar by purpose, page facts from front matter, an edit link to the source on every page, and a build that fails on any broken link or anchor. The build’s record is in quality/build.txt.
A pseudo-locale (qps-ploc) accents every letter, makes each string about 35% longer and brackets it. It isn’t a translation. Any word still plain on a pseudo page is a string a translator can’t reach.
First build: five labels hard-coded in English.After the fix: nothing left in English.
The labels became literal translate() calls. A first attempt built the message ID from a variable, and Docusaurus refused to extract it. The 1.1 revision then added code blocks with titles; the check found those titles in English too. What the source does for translators: one term per thing, labels quoted from the product, one sentence per line, ISO dates, fixed heading IDs and no idioms.
10Maintenance
Version 1.1 adds a way to reset many users with Keycloak’s admin REST API: after an OTP policy change, every user needs a reset, and the console does one at a time. Every command ran as written against the server, and a sign-in afterwards reached Mobile Authenticator Setup.
Testing the commands found a trap the console hides: a PUT of a user’s required actions replaces the whole list.
What the server answered
Before
["UPDATE_PROFILE"]
Sent
{"requiredActions":["CONFIGURE_TOTP"]}
After
["CONFIGURE_TOTP"]: the pending profile update was gone
So the guide reads the list first and adds to it, with a warning that says why.
Version 1.2: The Order of the Two Actions
A later security review of the steps asked what happens between them. Versions 1.0 and 1.1 deleted the credential first and added Configure OTP second. Signing in as the test user at that moment answered it:
What Keycloak asked for, between the two actions
Order
Asked for a code
Signed in with the password alone
Delete first (1.0, 1.1)
No
Yes
Required action first (1.2)
Yes
No
Version 1.2 adds the required action first, in the console and in the REST commands, and says why at the top of the steps. The film of the task, recorded on 19 November, still shows the first order; it is labelled as such until it is recorded again.
A proposal, not a report: this demonstration has no readers to measure, and I’ve invented no numbers. These are the questions I’d track for a page like this, and what I’d do with the answer.
Question
Signal
Source
Action
Can readers find it?
Help-center and docs searches with no result, and the words used
Search logs
Add the missing terms to titles, descriptions and redirects
Does it solve the task?
"Was this helpful?" answers and comments, per page
Page feedback widget
Read every "no"; fix the step it names
Does it reduce support load?
Tickets about second-factor resets per month, before and after
Support tool tags
A rise after a release means a page is out of date
Is it still true?
Days since last review against the review interval
Front matter and Git history
Review pages past due before a release
Is quality holding?
Vale errors and broken links per pull request
CI checks
Block the merge above zero
Is it ready to translate?
English left on pseudo-locale pages
scripts/check-pseudo.py
Block the merge above zero
12Before and After
Measure
Original article
Published docs
Pages
1
7
Words of prose
82
2635
Headings
0
21
Steps in the task
3, one of them wrong
14, each checked on the server
Pictures with alternative text
0 of 1
12 of 12
Owner, version, review date
None
On every page
Vale errors
7
0
History
One date, ambiguous
8 commits, and a Changes page
Longer, on purpose: the original was short because it left out the identity check, the step that makes the reset safe, the check, the settings and the failures. A reader who only needs the task reads one page of it.
AprilKaran’s assistant
April is an AI model answering from Karan’s notes. She can be wrong, so check the linked source.