I'm trying to get the user's identity from an adapter and I see that the documentation mentions two different APIs that look like having equivalent descriptions to me: getActiveUser
and getCurrentUserIdentity
.
Looks like the first one needs a realm as a parameter: https://stackoverflow.com/a/17018349/239408. I don't know about the other one.
The documentation also refers to a strong identity concept that I haven't seen described anywhere.
Should I prefer one method over another? When should I expect to have a "strong identity" and not get back a null?
When you have multiple realms, each one of them will have a userId. e.g. realm used for authenticating users will have userIdentity that describes user properties, i.e. username, date of birth, displayName. realm used for authenticating devices will have userIdentity describing device properties, i.e. deviceId, platform, OS version etc. getActiveUser(realm) will get you a userIdentity of the specified realm. if you do getActiveUser("wl_deviceNoProvisioningRealm") you'll get identity of the device (assuming you are using wl_deviceNoProvisioningRealm).
getCurrentUserIdentity() and getCurrentDeviceIdentity() APIs are built on top of getActiveUser(). You don't have to specify explicitly which realm is used to identify user and which realm is used to identify device, WL server will do this for you and you'll automatically get userIdentity of current user and userIdentity of current device.