Skip to content

Conversation

@bleathem
Copy link

Problem Statement

When a user's okta password is expired, Push verification fails with a cryptic JSON parse error:

Exception in thread "main" org.json.JSONException: JSONObject["factorResult"] not found.
at org.json.JSONObject.get(JSONObject.java:572)
at org.json.JSONObject.getString(JSONObject.java:859)
at com.okta.tools.authentication.OktaMFA.handlePushPolling(OktaMFA.java:307)
at com.okta.tools.authentication.OktaMFA.verifyAnswer(OktaMFA.java:285)
at com.okta.tools.authentication.OktaMFA.pushFactor(OktaMFA.java:242)
at com.okta.tools.authentication.OktaMFA.getSessionToken(OktaMFA.java:103)
at com.okta.tools.authentication.OktaMFA.promptForFactor(OktaMFA.java:64)
at com.okta.tools.authentication.OktaAuthentication.getOktaSessionToken(OktaAuthentication.java:87)
at com.okta.tools.saml.OktaSaml.getSamlResponse(OktaSaml.java:47)
at com.okta.tools.OktaAwsCliAssumeRole.doRequest(OktaAwsCliAssumeRole.java:132)
at com.okta.tools.OktaAwsCliAssumeRole.run(OktaAwsCliAssumeRole.java:102)
at com.okta.tools.WithOkta.main(WithOkta.java:28)

Solution

We can use the existing validateStatus method to validate the status of the json response for each poll response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant