Previous Topic: Generating PasscodesNext Topic: Resetting ArcotID OTP PIN


API Details

The following table lists the input and output parameters of the generateOTP() method:

Parameter

Description

Input Parameters

id

The unique identifier of the account.

Note: Use the getId() method to fetch this identifier.

pwd

ArcotID OTP PIN. This is the PIN that was associated with the account when the provisionAccount() method was called.

params

The parameters required for generating passcodes. You need to set the parameters based on the type of OTP to be generated. For example:

  • HOTP
    params.put(OTP.P_UN, "0123456789");
  • TOTP
    Hashtable params = new Hashtable();
    params.put(OTP.P_TIME, "123456789");
    params.put(OTP.P_UN, "0123456789");
    Note: As mentioned in the previous table, the P_TIME value needs to be provided only if an OTP is being generated for a time other than the current time.

 

  • CAP or DPA Mode 1
    Hashtable params = new Hashtable();
    params.put(OTP.P_MODE, OTP.M_1); params.put(OTP.P_AA, "123.45");
    params.put(OTP.P_UN, "0123456789");

 

  • CAP or DPA Mode 2 with TDS
    Hashtable params = new Hashtable(); params.put(OTP.P_MODE, OTP.M_2_TDS);
    params.put(OTP.P_DATA + "0", "123");
    params.put(OTP.P_DATA + "1", "456");
    params.put(OTP.P_DATA + "2", "789");

 

  • CAP or DPA Mode 3
    Hashtable params = new Hashtable();
    params.put(OTP.P_MODE, OTP.M_3);
    params.put(OTP.P_UN, "0123456789");

Output Parameters

params

params.get(A_TIMELEFT)

Here, the value of the A_TIMELEFT parameter is the time interval in seconds for which the TOTP is valid.

Exception

The OTPException class is returned if there any errors while signing the challenge. See chapter, "ArcotID OTP SDK Exceptions and Error Codes" for more information on the exception class and errors returned by ArcotID OTP SDK.