Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add google hangouts manual authentication option #22158

Merged
merged 5 commits into from
Apr 5, 2019

Conversation

teliov
Copy link
Contributor

@teliov teliov commented Mar 18, 2019

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

Description:

Authentication for the google hangout component fails even with correct auth credentials. The underlying library (hangups) which powers this component was updated to provide a manual authentication option. This PR provides an implementation of this update.

It allows the user to supply a manually obtained authorization code during setup which is then used to authenticate.

Related issue (if applicable): fixes #17705

Pull request in home-assistant.io with documentation (if applicable): home-assistant/home-assistant.io#8974

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • New dependencies have been added to the REQUIREMENTS variable (example).
  • New dependencies are only imported inside functions that use them (example).
  • New or updated dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.

@homeassistant
Copy link
Contributor

Hi @teliov,

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@awarecan
Copy link
Contributor

Could you confirm whether you still need username/password if you choose to use manual login method.

Actually, in my opinion, the auth_code way is better than save Google account password in HA.

@teliov
Copy link
Contributor Author

teliov commented Mar 18, 2019

Could you confirm whether you still need username/password if you choose to use manual login method.

Actually, in my opinion, the auth_code way is better than save Google account password in HA.

No, need for username/password using the manual login. Thought about removing them but I figured perhaps it might still work for some people so decided to leave it in.

Side question though, does the password get saved in HA ?? I had thought only the refresh token would be saved.

@awarecan
Copy link
Contributor

Aha, you are right, password is not saved.

https://github.com/home-assistant/home-assistant/blob/9591aa66ba07cc0e5f96580aa404e676600109c0/homeassistant/components/hangouts/config_flow.py#L100-L103

@teliov
Copy link
Contributor Author

teliov commented Mar 25, 2019

Hey @awarecan, any idea on when/if this would get merged (or if there are any issues with it) ?

Copy link
Contributor

@awarecan awarecan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job in general. The translation issue has to be fixed.

homeassistant/components/hangouts/config_flow.py Outdated Show resolved Hide resolved
homeassistant/components/hangouts/.translations/en.json Outdated Show resolved Hide resolved
self._credentials,
self._refresh_token)
if user_auth_code is None:
manual_login = False
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

manual_login = user_auth_code is not None

@MartinHjelmare MartinHjelmare changed the title Added option to use manual authentication for google hangout component Add google hangouts manual authentication option Mar 28, 2019
Copy link
Contributor

@awarecan awarecan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job! 🎉

Don't worry the mess up, that happens often then you may think.

@awarecan awarecan merged commit b3e60df into home-assistant:dev Apr 5, 2019
@ghost ghost removed the in progress label Apr 5, 2019
unibeck pushed a commit to unibeck/home-assistant that referenced this pull request Apr 7, 2019
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to authenticate Hangouts
4 participants