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

Can't Authenticate using app password. #675

Closed
bagelos opened this issue Mar 6, 2023 · 1 comment
Closed

Can't Authenticate using app password. #675

bagelos opened this issue Mar 6, 2023 · 1 comment

Comments

@bagelos
Copy link

bagelos commented Mar 6, 2023

Describe the bug

Can't Authenticate the google_home integration in HA.
I have looked at various old similar issues and tried the resolutions there. None have worked.
Issue appears to be Cannot authenticate.
Have previously had this configured though.
Rebuilt server moving to Ubuntu 22.04 and never been able to reconfigure.
Also tried the following but would not work due to issue getting MAC address.
I included the MAC address of a google home on my network and also output from logs above and output is below.

python3.11 get_tokens.py

This script generates tokens that can be used when making requests to the Google Home Foyer API.
There are 2 kinds of tokens used here:

  1. Master token - Is in the form aas_et/*** and is long lived. Needs Google username and password.
  2. Access token - Is in the form ya29.*** and lasts for an hour. Needs Master token to generate.
    If you do not want to store the Google account password in plaintext,
    get the master token once, and set it as an override value.
    It's safer/easier to generate an app password and use it instead of the actual password.
    It still has the same access as the regular password, but still better than using the real password while scripting.
    (https://myaccount.google.com/apppasswords)

[] Getting master token...
[!] Could not get master token.
[
] Master token: None

[] Getting access token...
[!] Could not get access token.
[
] Access token: None

[*] Done.

To replicate

add google_home integration via HACS
restart ha
attempt to configure integration and authenticate
add username (without @gmail.com) and use app password

Version of the integration

If you are unsure about the version check the github release here.

1.9.17
glocaltokens==0.7.0
gpsoauth==1.0.2
requests==2.28.2
requests-toolbelt==0.10.1
urllib3==1.26.14
uuid==1.30

Logs

2023-03-06 18:40:51.369 DEBUG (MainThread) [glocaltokens.client] Initializing new GLocalAuthenticationTokens instance.
2023-03-06 18:40:51.369 DEBUG (MainThread) [glocaltokens.client] Set GLocalAuthenticationTokens client access_token, homegraph, access_token_date and homegraph_date to None
2023-03-06 18:40:51.370 DEBUG (MainThread) [glocaltokens.client] Set GLocalAuthenticationTokens client username to "******", password to "***************", master_token to "" and android_id to
2023-03-06 18:40:51.370 DEBUG (SyncWorker_6) [glocaltokens.client] There is no stored master_token, logging in using username and password
2023-03-06 18:40:51.370 DEBUG (SyncWorker_6) [glocaltokens.client] There is no stored android_id, generating a new one
2023-03-06 18:40:51.370 DEBUG (SyncWorker_6) [glocaltokens.client] Generating android id...
2023-03-06 18:40:51.371 DEBUG (SyncWorker_6) [glocaltokens.client] Generated android id: a7574b3e185fd258
2023-03-06 18:40:52.826 ERROR (SyncWorker_6) [glocaltokens.client] [!] Could not get master token.
2023-03-06 18:40:52.827 DEBUG (SyncWorker_6) [glocaltokens.client] Request response: {'Error': 'BadAuthentication'}
2023-03-06 18:40:52.828 ERROR (MainThread) [custom_components.google_home]
@leikoilja
Copy link
Owner

Closed, because it's a duplicate of #599

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants