alexa / alexa-skills-kit-sdk-for-nodejs

The Alexa Skills Kit SDK for Node.js helps you get a skill up and running quickly, letting you focus on skill logic instead of boilerplate code.
Apache License 2.0
3.12k stars 736 forks source link

No mention of Account Linking or accessToken for user #49

Closed bjm88 closed 7 years ago

bjm88 commented 7 years ago

Most skills for Alexa will require a linked account to be personal and secure for a given user and their data. You have a detailed wiki on account linking and seem to support it fairly well for the platform overall. After linking my account and generating a test json message with the test harness in the AWS Alexa developer console I can see a linked account gets passed the session.user.accessToken value from the linking. However I do NOT see this mentioned anywhere in your documentation or sdk/library for a helper method or example about accessing and using it. It seems at minimum the READ.ME should be updated to mention and ideally have a helper method to access it safely if present.

https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/linking-an-alexa-user-with-a-user-in-your-system

Thank You.

brbeaird commented 7 years ago

+1 would really like to see this. Currently have been unable to figure out how to get the accessToken from this SDK.

brbeaird commented 7 years ago

Update: looks like you can access the token with this.event.session.user.accessToken

ghost commented 7 years ago

Will track this via #26 . Looking into the PR now

muneerkk66 commented 7 years ago

When we sent the request from iOS device to AVS service using this API https://avs-alexa-na.amazon.com/v20160207/events. The request will reach in lambda function from there i can see the token. But the token which i am receiving there is different. See the below lambda function from where i am getting token value.

def lambda_handler(event, context):

print(event['session']['user']['accessToken'])

My ultimate goal is to identify the user in lambda function. That's why i am passing the token to lambda using account linking process. Everything is working as expected but only issue i am facing the token is different.