ibm-mobilefirstmobilefirst-studiomobilefirst-runtime

IBM MobileFirst 7.1.0 WL.Device.getID changes on the same device


mfp -v 7.1.0.00.20160401-2108
wladm -version 7.1.0.00.20160323-1606

WL.Device.getId sometimes returns different id on the same device with app reinstallation or update from Store.
It happens both on Android and iPhone.
It happens only when app is reinstalled (updated), or switched from debug to release.
When installed the ID is persistent.
We use LDAP server where DeviceID is login value. So when ID changes I see the completely new login value from same device.

What could be reason of this behavior?


Solution

  • Background information:
    The device id generated by the MobileFirst SDK for android is stored in KeyStore file, and in iOS in keychain file. Both of these are not 100% guaranteed to keep the original stored values in cases such as application uninstallation/reinstallation/upgrade, end-user changing the device security settings or doing a factory reset.

    For these reasons it is not a recommended pattern to use the WL.Device.getId value as the principal login value.

    The recommended pattern is to use a unique user identity such as email, or username. Please note that future version of MFP may discontinue support for the WL.Device.getId API method.