Skip to content

OTP Authentication Validation

The OTPAuthValidation step validates the succeeded otp registration. It should be used after an OTPConfigurationStep and an authenticationtstep(SAML, OAuth2, and Basic).

If the validation fails, the steps clear the registration from the cookie store.

Input Parameters

Mandatory input parameters:

  • onboardingParameters – This setting is provided on the flowContext typically configured by the OTPConfigurationStep.

Using OTPAuthenticationStep

  1. Set the context and the onboarding settings in the flowContext.

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
      flowContext.setContext(callerActivity);
      try {
          OnboardingParameters onboardingParameters = new OnboardingParameters();
          onboardingParameters.setUrl(SERVICE_URL);
          onboardingParameters.setApplicationId(APPLICATION_ID);
          onboardingParameters.setApplicationVersion(APPLICATION_VERSION);
          onboardingParameters.build();
          flowContext.setOnboardingParameters(onboardingParameters);
      } catch (MalformedURLException e) {
        //error handling
      }
    
  2. Initiate the step.

    1
      OTPAuthenticationStep otpAuthenticationStep = new OTPAuthenticationStep();
    
  3. Specify the execute method's FlowActionHandler parameter's "onFailure" and "onSuccess" behaviour:

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
        flowManagerService.execute(flow, flowContext, new FlowActionHandler() {
            @Override
            public void onFailure(Throwable t) {
                //set the status, update the caller activity
            }
    
            @Override
            public void onSuccess(FlowContext result) {
                //set the status, update the caller activity
                //read the result
            }
      });