namadori
(Namadori)
February 7, 2018, 6:27pm
1
Hi all. I’m starting the development of a new component for Honeywell evohome thermostat, the new API requires OAuth2 authentication.
Is there a common “infrastructure” in HA for OAuth2 authentication?
If not, what’s the existing component with the best implementation to use as a reference?
Thanks.
1 Like
winter
February 7, 2018, 6:39pm
2
I was wondering the same thing a few months ago, but quickly became distracted with other things
namadori
(Namadori)
February 7, 2018, 6:54pm
3
I’ll try to setup a github repo and share the component from the beginning. I have little Python knowledge and little time, so I’m hoping in other people’s contribution
I have the same question. Any help on how to develop a component calling a API using OAuth2 authentification would be appreciated
Did anybody find an answer to this? I am in the same boat.
fredrike
(Fredrik Erlandsson)
August 18, 2018, 10:54pm
6
I’ve implemented support by copying form the Spotify component, but you are right there should be a standardized way to do it…
2 Likes
awarecan
(Jason Hu)
August 19, 2018, 1:50am
7
Better handled by upstream lib.
There are tons of example, you can check Nest.
Thanks guys, that was exactly what I was looking for.
Note that the Spotify code has moved to:
"""Support for interacting with Spotify Connect."""
from datetime import timedelta
import logging
import voluptuous as vol
from homeassistant.components.http import HomeAssistantView
from homeassistant.components.media_player import (
MediaPlayerDevice, PLATFORM_SCHEMA)
from homeassistant.components.media_player.const import (
MEDIA_TYPE_MUSIC, MEDIA_TYPE_PLAYLIST, SUPPORT_NEXT_TRACK,
SUPPORT_PAUSE, SUPPORT_PLAY, SUPPORT_PLAY_MEDIA, SUPPORT_PREVIOUS_TRACK,
SUPPORT_SELECT_SOURCE, SUPPORT_SHUFFLE_SET, SUPPORT_VOLUME_SET)
from homeassistant.const import (
CONF_NAME, STATE_IDLE, STATE_PAUSED, STATE_PLAYING)
from homeassistant.core import callback
import homeassistant.helpers.config_validation as cv
_LOGGER = logging.getLogger(__name__)
This file has been truncated. show original
You could just use a reverse proxy like nginx or traefik and use the external auth server project to enforce oauth: