Device Permissions

I’m having trouble with device permissions on SmartApp after the INSTALL life cycle. I’m wondering what the expected behavior is and if I have this right.

1 - Install app with 2/3 devices selected. After the app is installed, my app then requests the device info for these 2 devices and obtains it from the API.
2 - User updated the app and selects 3/3 of the available devices and saves. UPDATE lifecycle is called and my app can see that a permission CONFIG was created r/w for the new device.
3 - My app tries to get the info of the newly added device but I get a 403 forbidden error.

I tried getting a fresh auth token for the app and using that for the device info API endpoint and I still get a 403 Error. I can see that the device is listed in permissions with R and W and the device key listed for the installed app. Everything seems to be in place. Is there an issue with the API endpoint?

Everything works find on the INSTALL phase but when updating, it seems like permissions aren’t updated. I can’t access newly added devices.

Solved my issue…

My app wasn’t updating the auth_token received in updateData during the UPDATE lifecycle. Because the old key is associated with old permissions, that key only has access to the permissions it had during it’s app lifecycle. Updating the token on each lifecycle action and then using that to fetch the device info works.

2 Likes