Security/Auth trainer
Password Policy API Practice
Practice password rule validation, breached password checks, Unicode and whitespace boundaries, policy migrations, safe errors, and accessibility.
How to use this trainer
Choose, send, inspect, write, improve
Safe client-side simulator. No real backend is called and no real data is sent.
- 1Choose a preset case
- 2Send a simulated request
- 3Read the response and QA note
- 4Write what you would test
- 5Check your coverage
Interactive sandbox
Try the API request
Pick a preset, send a simulated POST /api/auth/password-policy/validate request, inspect the fake response, and turn it into test ideas.
Passwords are fake local examples only and are never sent anywhere.
Request
Build the request
/api/auth/password-policy/validateRequest JSON
application/json{
"password": "CorrectHorseBatteryStaple!42",
"flow": "signup",
"locale": "en"
}Test case presets
Choose a case, inspect the fake response, then write what you would test.
Happy path
Validation
Security
Boundaries
Reliability
Response
Fake API result
List valid, too short, too long, weak/common, breached, Unicode, whitespace, confirmation mismatch, localized errors, rate limits, provider outage, safe logs, and policy consistency.
Tip: a stronger answer usually mixes happy path, negative cases, state changes, data, backend, UX, accessibility, and risk.
How to structure your answer
API ReferenceEndpoint, request fields, responses, and business rulesExpandCollapse
API reference
Password Policy endpoint
Validate password policy consistently across signup, password reset, and change-password flows.
Endpoint
/api/auth/password-policy/validatePurpose
Validate password policy consistently across signup, password reset, and change-password flows.
Request fields
- password: string, required
- flow: signup | reset | change
- locale: optional language code
- confirmation: optional client-side helper
Success response
200 OK
Request body
{
"password": "CorrectHorseBatteryStaple!42",
"flow": "signup",
"locale": "en"
}Example response body
{
"valid": true,
"requirements": ["minLength", "notBreached"]
}Errors
- 400 validation error
- 413 password too long
- 422 weak or breached password
- 429 rate limited
- 503 breach provider unavailable
Security notes
- Password is never returned
- Password is never logged
- Policy errors avoid account enumeration
- External breach checks handle outage safely
Business rules
- Same policy applies across auth flows unless configured
- Messages are localizable and accessible
- Policy migrations do not strand existing users
- Metrics exclude password values