How do I transition Alexa Component to use long-lived token rather than api_password?

The documentation for the component still references passing the api_password.

I’ve found a couple threads on the forum, but they all seem to be Haaska-specific.

Can someone post steps to transition to long-lived tokens for someone that’s already using the component? And optionally, update the documentation…

The latest HA Podcast mentioned that you can just do OAuth with Alexa now. I haven’t seen any documentation on how to do that yet, though. Playing around this morning, I’ve been able to use the account linking to HA with a custom skill, but haven’t pushed it past that yet.

In the Amazon Developer Console, under your skill, Build, and then account linking, you can set up the OAuth flow.

  • turn on account linking
  • turn off using the skill without linking account
  • use auth code grant
  • authorization uri: https://your_ha/auth/authorize
  • access token uri: https://your_ha/auth/token
  • client id: https://pitangui.amazon.com
  • client secret: ?
  • auth scheme: HTTP Basic

This at least seems to auth, but I need to create/set up my intents again for reasons unrelated to this change. The client ID seems to require coming from the same location that the amazon-generated redirect url will be, which is why I had to use pitangui - but there are three listed redirect URLS on the bottom of that page, so I’m not sure what the truly correct thing to here yet.

1 Like