0

I'm creating an Alexa Skill to control my Philips Hue lights. Everything works as expected, however the token expires after a couple of weeks and Alexa does not refresh the token. I am assuming this is because the Alexa skill setup only takes one URL which is supposed to be able to be used to both acquire a token and refresh a token, however the Hue API has two separate endpoints:

https://api.meethue.com/oauth2/token to get a token and https://api.meethue.com/oauth2/refresh to refresh.

Is there any way to get around this issue in the Alexa setup or with the Hue API?

ragurney
  • 424
  • 5
  • 16

1 Answers1

0

I ended up writing a new lambda function which served as a reverse proxy to the Hue API. I would direct to the /token or /refresh endpoints based on the grant_type passed in the request body.

It would be nice if Hue resolved this discrepancy but this solution seems to work and I learned some things along the way

** If anyone needs the code for the above let me know. It's still in a private repo but I'm planning to open-source it soon.

ragurney
  • 424
  • 5
  • 16
  • To see the code for the proxying I came up with, it's in this repo https://github.com/ragurney/hue-config under the `authorization` lambda – ragurney Jan 22 '20 at 00:17