Add google hangouts manual authentication option (#22158)

* Added option to use manual authentication for google hangout component
See: https://hangups.readthedocs.io/en/latest/user_guide.html#logging-in for manual log in example

Bumped up version of hangups to 0.4.9

* Updated components/hangouts/strings.json and generated translation string by running script/translations_develop
Reduced verbosity of modifications to components/hangouts/config_flow.py

* Added option to use manual authentication for google hangout component
See: https://hangups.readthedocs.io/en/latest/user_guide.html#logging-in for manual log in example

Bumped up version of hangups to 0.4.9

* Updated components/hangouts/strings.json and generated translation string by running script/translations_develop
Reduced verbosity of modifications to components/hangouts/config_flow.py

* fixing missing rebase
This commit is contained in:
teliov 2019-04-05 19:11:04 +02:00 committed by Jason Hu
parent 879967bed2
commit b3e60df82a
7 changed files with 57 additions and 10 deletions

View file

@ -13,7 +13,7 @@ class HangoutsCredentials(CredentialsPrompt):
This implementation gets the user data as params.
"""
def __init__(self, email, password, pin=None):
def __init__(self, email, password, pin=None, auth_code=None):
"""Google account credentials.
:param email: Google account email address.
@ -23,6 +23,7 @@ class HangoutsCredentials(CredentialsPrompt):
self._email = email
self._password = password
self._pin = pin
self._auth_code = auth_code
def get_email(self):
"""Return email.
@ -54,6 +55,20 @@ class HangoutsCredentials(CredentialsPrompt):
"""
self._pin = pin
def get_authorization_code(self):
"""Return the oauth authorization code.
:return: Google oauth code.
"""
return self._auth_code
def set_authorization_code(self, code):
"""Set the google oauth authorization code.
:param code: Oauth code returned after authentication with google.
"""
self._auth_code = code
class HangoutsRefreshToken(RefreshTokenCache):
"""Memory-based cache for refresh token."""