use of com.okta.authn.sdk.resource.ActivateFactorRequest in project okta-auth-java by okta.
the class LoginResource method activateMfa.
@POST
@Path("/mfa/activate/{factorType}")
public void activateMfa(@FormParam("passCode") String passCode) throws AuthenticationException {
AuthenticationResponse previousAuthResult = getPreviousAuthResult();
String factorId = previousAuthResult.getFactors().get(0).getId();
ActivateFactorRequest request = authenticationClient.instantiate(ActivatePassCodeFactorRequest.class).setPassCode(passCode).setStateToken(previousAuthResult.getStateToken());
authenticationClient.activateFactor(factorId, request, new ExampleAuthenticationStateHandler());
}
Aggregations