glocaltokens
glocaltokens copied to clipboard
Can't get client.get_google_devices_json to work with master_token instead of password
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!
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" )
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