Search in sources :

Example 1 with VerifyFactorRequest

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

the class LoginResource method recoverChallenge.

@POST
@Path("/recover/verify")
public void recoverChallenge(@FormParam("passCode") String passCode) throws AuthenticationException {
    AuthenticationResponse previousAuthResult = getPreviousAuthResult();
    VerifyFactorRequest request = authenticationClient.instantiate(VerifyPassCodeFactorRequest.class).setPassCode(passCode).setStateToken(previousAuthResult.getStateToken());
    authenticationClient.verifyFactor(previousAuthResult.getFactors().get(0).getId(), request, new ExampleAuthenticationStateHandler());
}
Also used : ExampleAuthenticationStateHandler(com.okta.authn.sdk.example.ExampleAuthenticationStateHandler) AuthenticationResponse(com.okta.authn.sdk.resource.AuthenticationResponse) VerifyFactorRequest(com.okta.authn.sdk.resource.VerifyFactorRequest) 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 VerifyFactorRequest (com.okta.authn.sdk.resource.VerifyFactorRequest)1 POST (javax.ws.rs.POST)1 Path (javax.ws.rs.Path)1