1

Step 1
When I submit answer in handle challenge of WL.Client.createWLChallengeHandler in the very first request, the headers section contains wl_deviceNoProvisioningRealm which also contains a device ID which is different from the device id received when using WL.Device.getID.

At the time of login, the server saves the device id and at the time of accessing the protected resources, it compares the device id with oAuthSecurityContext.getDeviceIdentity().getId() in order to maintain unique login: one device - one user.

{"AppRealm":{"parameters":{"reqURL":"/mobile/user/authentication","user.name":"tesla","user.password":"password","user.deviceId":"025bdc29-959c-4b0c-8a89-cf85b0790aaf"},"headers":{}},"wl_deviceNoProvisioningRealm":{"ID":{"token":"o2rp4qn6skhij80v2lk74bq2nu","app":{"id":"ollections","version":"1.0"},"device":{"id":"+obkd/fe9Py8y9/RVgVqT3oot2sl6FzVE1AKAAOOHww=","os":"8.10.14234.0","model":"RM-1019_1003","environment":"windowsphone8"},"custom":{}}}}

Step 2
When handling a scenario of a failure occurring due to wrong login credentials, if I submit the answer again in the second request, wl_deviceNoProvisioningRealm is not present so the device Id can't be received on server-side.

See below object:

{"AppRealm":{"parameters":{"reqURL":"/mobile/user/authentication","user.name":"tesla","user.password":"password","user.deviceId":"025bdc29-959c-4b0c-8a89-cf85b0790aaf"},"headers":{}}

why am I getting different device IDs in Windows Phone only but same device ID in Android and iOS?

ID generated by IMF request auth header: +obkd/fe9Py8y9/RVgVqT3oot2sl6FzVE1AKAAOOHww=
ID generated by Wl.Device.getID : 025bdc29-959c-4b0c-8a89-cf85b0790aaf

Idan Adar
  • 44,156
  • 13
  • 50
  • 89
AMAN BIRDI
  • 21
  • 4
  • Are you tracking device id at the server? Trying to understand what is the issue you are facing? – Vivin K Nov 08 '16 at 14:18
  • yes. while login , on server we fetched the device id and saved to db after fetching from request :String header = request.getHeader(AUTHORIZATION_HEADER); JSONObject headerJSON = JSONObject.parse(header); JSONObject deviceNoProvisioningJSON = (JSONObject) headerJSON.get("wl_deviceNoProvisioningRealm"); if(deviceNoProvisioningJSON != null){ JSONObject idJSON = (JSONObject) deviceNoProvisioningJSON.get("ID"); JSONObject device = (JSONObject) idJSON.get("device"); deviceId = (String) device.get("id"); – AMAN BIRDI Nov 08 '16 at 14:21

0 Answers0