Search in sources :

Example 1 with VerifyRecoveryRequest

use of com.okta.authn.sdk.resource.VerifyRecoveryRequest in project okta-auth-java by okta.

the class LoginResource method unlockAccountChallenge.

@POST
@Path("/unlock/recovery")
public void unlockAccountChallenge(@FormParam("passCode") String passCode) throws AuthenticationException {
    AuthenticationResponse previousAuthResult = getPreviousAuthResult();
    VerifyRecoveryRequest request = authenticationClient.instantiate(VerifyRecoveryRequest.class).setStateToken(previousAuthResult.getStateToken()).setPassCode(passCode);
    authenticationClient.verifyUnlockAccount(previousAuthResult.getFactors().get(0).getType(), request, new ExampleAuthenticationStateHandler());
}
Also used : ExampleAuthenticationStateHandler(com.okta.authn.sdk.example.ExampleAuthenticationStateHandler) AuthenticationResponse(com.okta.authn.sdk.resource.AuthenticationResponse) VerifyRecoveryRequest(com.okta.authn.sdk.resource.VerifyRecoveryRequest) Path(javax.ws.rs.Path) POST(javax.ws.rs.POST)

Aggregations

ExampleAuthenticationStateHandler (com.okta.authn.sdk.example.ExampleAuthenticationStateHandler)1 AuthenticationResponse (com.okta.authn.sdk.resource.AuthenticationResponse)1 VerifyRecoveryRequest (com.okta.authn.sdk.resource.VerifyRecoveryRequest)1 POST (javax.ws.rs.POST)1 Path (javax.ws.rs.Path)1