0
votes

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?

1

1 Answers

0
votes

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.