Search code examples
python-3.xalexa-skills-kitgoogle-account

How to test Alexa account linking in my developer console?


I know for Alexa account linking user need to create his security profile in amazon developer and after that, a user needs to setup account linking in Alexa developer console for google sign in with Alexa skill. But now the question is how can user test the Alexa account linking without publishing that skill? because my skill is still in development and I want to check google sign in with Alexa in my developer console! So Is it possible to do? And if it is possible then please guide me how can I do that!

I am using python-ask for Alexa and for google sign in we need access token and I could not get access token in it! Here is my code:

from ask_sdk_core.skill_builder import SkillBuilder
from alexa.data import MORNING_WISHES
sb = SkillBuilder()

    @sb.request_handler(can_handle_func=is_intent_name("MorningWishesIntent")  
    def morning_wishes_intent_handler(handler_input):
        try:
            accessToken=handler_input.request_envelope.context.\
            system.user.access_token
            print(accessToken)
            speech_text = random.choice(MORNING_WISHES)      
            handler_input.response_builder.speak(speech_text).\
            set_should_end_session(False)
        except Exception as e:
            speech_text = RESPONSES['EXCEPTION_MSG']
            handler_input.response_builder.speak(speech_text).\
            set_should_end_session(False)
        return handler_input.response_builder.response

And as per the above code, I get none in access token and I tried to test account linking with my Alexa developer console without publishing the skill!


Solution

  • Developer console doesn't support account linking cards so there is no way to test it there. You should test account linking using alexa app or going to the alexa amazon website. Just remember to login with your developer account which has access to the skill. You'll find your account linking card there with the link with which you should be able to test if it works properly. Also you can go find your skill, in the skills tab and then go to the setting of that skill and test account linking from there.