question

Anil avatar image
Anil asked

Are user ids unique for each app publisher?

Will a user, using different apps from different publishers, be given the same userId on each of them? From a customer's point of view, I think having different userIds for each publisher would be the best experience. It would help prevent tracking, targeted ads and other mischief. Currently, I have one app that uses userIds as port of an encryption key. It would be more secure if I knew that apps from other developers would never know the user ids given to my app. Just a thought. Anil
alexa skills kitdebugging
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Stefan Negritoiu avatar image
Stefan Negritoiu answered
As far as I understand the system, the same Alexa identity will show up as distinct userIds to each app. In other words userIds are scoped per appId. That being said if you rely on that identifier as some sort of salt and it's crucial to guarantee uniqueness in the context of your own app, it's probably best that you generate your own GUIDs. Stefan
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Fabien@Amazon avatar image
Fabien@Amazon answered
Hi Anil, Correct, user IDs are different for each publisher for the reasons you mention. User IDs will be identical for multiple applications from the same publisher. But other publishers will see a different user ID for the same actual user.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Mehmet Gokhan Sevik avatar image
Mehmet Gokhan Sevik answered
Related to this question, how can I get the user Id? if I use "session" to read user id (session.getUser()), it seems like changing for every call. I started hello world app 3 times and here are the user Ids. user=com.amazon.speech.speechlet.User@3ed24bb1 user=com.amazon.speech.speechlet.User@7926bf73 user=com.amazon.speech.speechlet.User@1efe71fb Similarly, Application Id changes for every call as well. Am I missing anything? is there another way to get application and user id? Thank you, Gokhan
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Mehmet Gokhan Sevik avatar image
Mehmet Gokhan Sevik answered
My mistake; session.getUser() returns a User object. I was printing the User object and because different object is created for every request, they were different. User object has getUserId() method. That should be the one I need to compare between the sessions. Sorry for the noise. Gokhan
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.