In the AWS Shadow example, the client token parameter is the ID of an account in Akexa?


I’m developing a skill in Alexa that modifies the Shadow document through a lambda function.

In the Shadow demo there is a parameter called client token,

    "{"                         \
    "\"state\":{"               \
    "\"desired\":{"             \
    "\"powerOn\":%02d"          \
    "}"                         \
    "},"                        \
    "\"clientToken\":\"%06lu\"" \ <--------------------------------

Is this parameter the same user account ID of an Alexa account?

If not, how can I identify the user for each hardware that uses the Shadow demo with the clientToken?

I want something simple, for the moment. I know that there are more secure and complex methods, where the hardware saves an ID in a DynamoDB account, and then from a mobile app it is linked to the account, and there is an identification.

I know this is safer and more professional, but for the moment I want something simple.

it’s possible?

Hello @DominusDRR .

Thanks for reaching out.

The clientToken in Shadow is a string unique to the device that enables you to associate responses with requests in an MQTT environment. It has no direct relation to Alexa account ID. The value of clientToken is defined by user when publishing to /update topic. In the shadow example the value of clientToken is the current timestamp of publishing to /update topic. When the device receives an accepted/rejected response from the publish, it verifies the clientToken is the same as from the publish.

As for integrating with Alexa, I’d recommend reaching out to Amazon Developer Forum. They have more context on Alexa specific knowledge.

Please let me know if you have further questions.

Thank you very much for the clarification.