Verify Password (Java) Skip to main content
https://support.okta.com/help/answers?id=9062a000000qujvqas&refurl=http%3a%2f%2fsupport.okta.com%2fhelp%2fanswers
How satisfied are you with the Okta Help Center?
Thank you for your feedback!
How satisfied are you with the Okta Help Center?
1
2
3
4
5
Very Dissatisfied
Very satisfied
Enter content less than 200 characters.
Ask Search:
Flavel HeymanFlavel Heyman 

Verify Password (Java)

When a user is changing their security question we want to validate their password before the change is made (even though they are already logged in and have a valid token).

How does one check the password and username align?
Flavel HeymanFlavel Heyman

Seems the credentials couldn't just be retrieved and then change the security question without loading the password anyway:

https://github.com/okta/okta-sdk-java/blob/8965f51aca53ee37239ab9db9af3ec067692df37/integration-tests/src/test/groovy/com/okta/sdk/tests/it/UsersIT.groovy

excerpt:

UserCredentials userCredentials = user.changeRecoveryQuestion(client.instantiate(UserCredentials)
            .setPassword(client.instantiate(PasswordCredential)
                .setValue('Abcd1234'))
            .setRecoveryQuestion(client.instantiate(RecoveryQuestionCredential)
                .setQuestion('How many roads must a man walk down?')
                .setAnswer('forty two')))