Hello there,
My company is looking to store a user’s last successful and last failed login attempts.
Based on the user API it’s simple enough to retrieve the last login but there doesn’t seem to be a way to retrieve the last failed login.
Any help would be appreciated!
Use the Okta System Log API: System Log | Okta Developer
I think this should get you what you want.
–All failures
/api/v1/logs?filter=outcome.result+eq+%22FAILURE%22+and+outcome.reason+eq+%22INVALID_CREDENTIALS%22
–Failure of a user who’s ID is abcdefghijklmnopq123
/api/v1/logs?filter=outcome.result+eq+%22FAILURE%22+and+outcome.reason+eq+%22INVALID_CREDENTIALS%22+and+actor.id+eq+%22abcdefghijklmnopq123%22