<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
0D54z00007eR84bCACOkta Identity EngineSingle Sign-OnAnswered2026-06-01T22:57:28.000Z2022-05-16T06:54:42.000Z2026-06-01T22:57:28.000Z

servicea.28287 (Customer) asked a question.

How to get no. of failed login attempts

Hello, everyone. I have a requirement to indicate the number of retries left for successful sign in. After three failed login attempts, the user's account will be locked. If I type the erroneous password for the first time, it will indicate two attempts remaining, then one attempt remaining, and then the account will be locked. As far as I can tell, OKTA has no API that can return the number of failed login attempts. I tried using the logs API and it worked perfectly. However, I'd like to add a filter for fetching logs from the last 30 minutes, so that I can count unsuccessful login attempts from the logs and add logic to the UI. Please consider the following curl:

 

curl --location --request GET 'https://singlife.oktapreview.com/api/v1/logs?limit=3&filter=legacyEventType eq "core.user_auth.login_failed" and actor.alternateId%20eq%20%22%2B9182xxxxxxxx%22 and outcome.reason eq "INVALID_CREDENTIALS"' \

--header 'Accept: application/json' \

--header 'Content-Type: application/json' \

--header 'Authorization: SSWS {}' \

--header 'Cookie: JSESSIONID=6CC2E2E5830F252BE4C2C366D62B931F; JSESSIONID=A3726D58DC05E5BABDD9536822918398'

 

 


This question is closed.
Loading
How to get no. of failed login attempts