Migrating from Core API to FastTrack API

Note
  • Performing this migration updates your SDK version to include FastTrack API.
  • For existing customers of Core API who are migrating to FastTrack API, you can also migrate your tokens to access the APIs in FastTrack API.

Migrating existing tokens from Core API to FastTrack API

To migrate existing tokens generated from Core API to FastTrack API, perform the following steps:

  1. Check that the token has been created with Core API.
  2. Configure the parameters required by FastTrack API and its Protector OATH.
  3. Create the token setting.
  4. Retrieve the token device with settings.
  5. Generate an OTP using FastTrack API.

The following sample code snippet shows how to perform the migration of existing tokens from Core API to FastTrack API:

Deprecated APIs:

From Protector OATH SDK V6.0, all persist setting related APIs are deprecated. For example, persistSettingsWithTokenDeviceName on iOS or persistTotpSettings on Android. Use the new tokenDeviceWithName, tokenDeviceWithUserTokenID on iOS or getTokenDevice, getTokenDeviceWithUserTokenId with OTP settings instead to allow you to pass the settings dynamically to retrieve the token device.

// 1. Token is created already with Core API
 
// 2. Configure the FastTrack & Protector
FastTrack.configureSecureLog(slogConfig);
FastTrack mFastTrack = new FastTrack.Builder(mContext)
        .withDeviceBinding(true)
        .withActivationCode(FULL_ACTIVATION_CODE)
        .build();
 
OathMobileProtector protector = mFastTrack.getOathMobileProtectorBuilder(
        new URL(mOathEps.getProvisioningUrl()),
        mOathEps.getEpsDomain(),
        mProtocol,
        mOathEps.getRsaKeyId(),
        mOathEps.getRsaKeyExponent(),
        mOathEps.getRsaKeyModulus()
).build();

// 3. Create Token Setting
HotpSettings hotpSettings = new HotpSettings();
hotpSettings.setHotpHashAlgorithm(OathMobileProtector.HashAlgorithm.SHA1);

// 4. Retrieve the token device with settings.
// This is a new API in version 6.0, to pass the settings dynamically when retrive the token device
OathTokenDevice tokenDevice = protector.getTokenDevice(tokenName, fingerprintData, hotpSettings);
 
// 5. Generate OTP with FastTrack API
String pin = "9444";
String otp = tokenDevice.getOtp(pin);

Migrating existing client ID from Core API to FastTrack API

To migrate existing client ID generated from Core API to FastTrack API, perform the following steps:

  1. Check that the client ID has been created with Core API.
  2. Configure the FastTrack API and its Mobile Messenger.
  3. Check that the client ID exists using new FastTrack API. Otherwise, call the persistClientID API.
// 1. ClientID is created already with Core API
 
// 2. Configure the FastTrack API and its Mobile Messenger
FastTrack.configureSecureLog(slogConfig);
new FastTrack.Builder(mContext)
        .withDeviceBinding(true)
        .withActivationCode(FULL_ACTIVATION_CODE)
        .build();

MobileMessenger mobileMessenger = FastTrack.getInstance().getMobileMessengerBuilder(MessengerConfigurations.getMessengerServerUrl(),
                MessengerConfigurations.getDomain(),
                MessengerConfigurations.getApplicationId(),
                MessengerConfigurations.getPublicKey().getPublicExponent().toByteArray(),
                MessengerConfigurations.getPublicKey().getModulus().toByteArray())
                .build();

// 3. Check the client ID exists using new FastTrack API
if (mobileMessenger.listClients() == null) {
	// 4. Call the PersistClientID, Make sure there's no client ID exists for FastTrack API
	mobileMessenger.persistClientId(userId, clientId);  
}