
JenishaP.83116 (Customer) asked a question.
According to https://developer.okta.com/docs/reference/api/authn/*response-example-for-primary-authentication-with-a-public-application-and-show-lockout-failures, if the password policy is configured to hide lockout failures, a 401 Unauthorized error is returned. This is the default behaviour because Okta configures password policies to hide lockout failures by default.
However, even after enabling the “Show lock out failures” setting for the password policy, I still get 401 Unauthorized errors via the /api/v1/authn endpoint for locked out user accounts, whether using correct or incorrect credentials
I’ve also disabled the User enumeration prevention feature, as explained in https://support.okta.com/help/s/article/unable-to-sign-in-error-instead-of-self-service-unlock-when-show-lockout-failures-is-enabled-in-okta?language=en_U
On the UI side, I see the following, whether using correct or incorrect credentials :

Hello @JenishaP.83116 (Customer) Thank you for posting on our Community page!
I understand how frustrating it can be when you’ve followed the documentation to the letter and the API still isn't behaving as expected. You’ve already tackled the two most common culprits by enabling Show lockout failures and disabling User enumeration prevention.
The reason you are still receiving a generic 401 Unauthorized on the API (and a generic "Unable to sign in" on the UI) comes down to how the Okta Authentication API handles state transitions.
The Missing Piece: Self-Service Account Unlock
The /api/v1/authn endpoint operates as a state machine. When it returns the LOCKED_OUT status, the JSON payload is designed to include a _links object containing the next step for the user—specifically, the unlock action.
If Self-Service Account Unlock is disabled in the user's password policy, or if the user hasn't enrolled in the required recovery authenticators, Okta has no "next step" to offer. Because the state machine cannot transition the user to a recovery flow, it drops the transaction entirely and falls back to a generic 401 Unauthorized error to prevent a dead-end API state.
How to Fix It To get the expected LOCKED_OUT API response and the correct UI prompt, you need to ensure the user is actually allowed to unlock their account:
Once self-service recovery is permitted and accessible for that specific user, the /api/v1/authn endpoint will successfully return the LOCKED_OUT status along with the recovery links.
Thank you for reaching out to our Community and have a great day!
--
Help others in the community by liking or hitting Select as Best if this response helped you.
Hi Paul,
Thank you for your thorough answer. I am now able to initiate account recovery after adding a password rule allowing self-service account unlocking
For your last point, there is no rate-limiting or throttling. However, if there was, wouldn't the response be a 429, as documented in https://developer.okta.com/docs/reference/api/authn/#response-example-for-primary-authentication-with-a-public-application-and-show-lockout-failures ?
Hello @JenishaP.83116 (Customer) Depending on the API you make, sometime if does not show. But I am glad you got it to work!