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 get client.get_google_devices_json to work with master_token instead of password #207

Open
falldeaf opened this issue Dec 23, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@falldeaf
Copy link

Describe the bug
Using a client without password doesn't seem to work even though I've previously retrieved a master token and supplied it to the client. I'm getting an error that it can't find the master token, still, and it's still looking for the username and password.

DEBUG:glocaltokens.client:Initializing new GLocalAuthenticationTokens instance.
DEBUG:glocaltokens.client:Set GLocalAuthenticationTokens client access_token, homegraph, access_token_date and homegraph_date to None
DEBUG:glocaltokens.client:Set GLocalAuthenticationTokens client username to "f*******", password to "", master_token to "a******************************************************************************************************************************************************************************************************************************" and android_id to
DEBUG:glocaltokens.client:Initializing models list if empty...
DEBUG:glocaltokens.client:Getting homegraph...
DEBUG:glocaltokens.client:There is no stored homegraph, or it has expired, getting a new one...
DEBUG:glocaltokens.client:There is no access_token stored, or it has expired, getting a new one...
ERROR:glocaltokens.client:Username and password are not set.
DEBUG:glocaltokens.client:Unable to obtain master token.
DEBUG:glocaltokens.client:[GRPC] Unable to obtain access token.
DEBUG:glocaltokens.client:Failed to fetch homegraph

To Reproduce
Running the get token script with user and pass first, obtaining the master token, then commenting out the password and adding the master_token variable.

client = GLocalAuthenticationTokens(
username="username",
master_token="aas_et/mastertokenhere",
#password="realpasshere",
verbose=True,
)

Expected behavior
I'm hoping to use the master token in place of the password and delete it from the folder. Apologies if this is user error!

@falldeaf
Copy link
Author

Solved this one, username and password variables must be listed in the client object with their values set to: "None" like this:

client = GLocalAuthenticationTokens(
username="None",
master_token="aas_et/mastertokenhere",
password="None"
)

@leikoilja
Copy link
Owner

Nice, happy you found a workaround, @falldeaf.
I will reopen the issue since the behaviour you are explaining is not right.
You are passing strings None to the client for both username and password and the client prioritise authentication using master_token. This needs to be checked and fixed if so

@leikoilja leikoilja reopened this Jan 3, 2022
@leikoilja leikoilja added the bug Something isn't working label Jan 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants