I created an Alexa Smart Home Skill to go enhance my home automation setup. The goal is to look into voice controlling my Raspberry Pi via Alexa. To do so I followed this Amazon developer blog to reach the mandatory account linking between the Alexa skill and an authentication provider. In this case this provider is Login with Amazon (LWA).

However following the instructions and using the skills redirection URL starting with https://pitangui.amazon.com/api/skill/link/.... proved to be utterly unsuccessful and just earned me a very non-descriptive error message. Essentially just saying that it didn't work. Great.

How do I make the LWA work with my Alexa skill?

After some fiddling around with the involved Amazon components I figured it out. The blog itself and its focus on what the URL starts with is actually rather unhelpful or even misleading. In fact the solution is annoyingly easy. All the provided URLs have to be entered as redirect-URLs, not just the pitangui URL that is mentioned in the blog. Apparently nowadays the skills offer more different redirect URLs that have to be added.

AlexaSkillAccountLinking

When both redirect URLs are entered into the security profile the authentication goes smoothly.

LWASecurityProfile

This screen allows us to authenticate oneself to the skill with the Amazon credentials. Problem solved. Now the security profile works and I have successfully activated my custom Alexa skill on my Echo.

LWAAuthentication

I'm trying to use LWA for my skill. I followed that log as well. The code in the log is using the request module in npm. However, when I try to use it in my code it does not work. JSON output from Alexa is null. enter image description here

I tried to use 'this.emit' to debug. Then I figure that Alexa just will not enter in the 'request(amznProfileURL, function(...))'. How did you work out the code?

  • Hi Richard, this might be better as a separate question. I did'nt actually code anything for the linking, I just did it on the GUI in the configuration wizard. – Helmar Apr 23 at 18:58

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.