ha-google-home icon indicating copy to clipboard operation
ha-google-home copied to clipboard

Getting the error: master_token doesn't follow the AAS_ET format

Open kaizersoje opened this issue 1 year ago • 14 comments

Describe the bug

I am using HA 2023.12.2 and the google_home v1.10.2 . I used the Docker method to get the master token using the app password. The token was generated successfully. I then tried to add the integration and then I get the following error in the log.

2023-12-14 11:35:27.482 ERROR (MainThread) [glocaltokens.client] master_token doesn't follow the AAS_ET format

I have tried out all possible combinations with/without @gmail.com, app password/account password, tripple checked for any blank spaces and etc but nothing worked out.

My master token is in the format:

aas_et/AKppINabdfhtfy6ughnghjghjgjghbhhbnmnghjhjghjghjghjghjgh

Version of the integration

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

1.10.2

Logs

2023-12-14 11:35:27.482 ERROR (MainThread) [glocaltokens.client] master_token doesn't follow the AAS_ET format

kaizersoje avatar Dec 14 '23 00:12 kaizersoje

The check is pretty simple.

  1. Token must start with aas_et/
  2. Token must be exactly 223 characters long.

Make sure you copied the whole thing.

KapJI avatar Dec 14 '23 00:12 KapJI

Yes, I did. I cropped it for the purpose of this ticket. I have replaced some characters in the generated master token.

aas_et/AK----a--tE--e----5---K--------5------------------8-A8--K-49----------7K-_----t---E--k5-A-5----4-------E--------a---------TK4-as-------E----7-----A--t-9--K--t-------e--------6---9-eS---e--9-----==

kaizersoje avatar Dec 14 '23 00:12 kaizersoje

When I pasted the token in MS Office Word, it tells me that there are only 203 characters. I have copied the token exactly as it was generated.

kaizersoje avatar Dec 14 '23 01:12 kaizersoje

MS Word is not the best tool for this, it can automatically replace some characters with something else. Try Notepad instead.

KapJI avatar Dec 14 '23 10:12 KapJI

I tried an online character count website as well. Same thing. I tried VS Code as well and it shows 203 characters.

kaizersoje avatar Dec 14 '23 11:12 kaizersoje

Any advice @leikoilja?

kaizersoje avatar Dec 19 '23 02:12 kaizersoje

this is the first time we heard that token length is 203 instead of 223 characters. @kaizersoje do you have access to any other accounts to check the length of the master token there? We can cater for 203 chars as well as 223, but we would need to know if it's google's new pattern? 🤔

leikoilja avatar Dec 19 '23 07:12 leikoilja

Hi @leikoilja I am away on holiday at the moment. So it will be a while I can look into this.

kaizersoje avatar Dec 26 '23 03:12 kaizersoje

Hi, I'm having a similar issue but my token is 224 chars long (checked with echo 'aas_et/.....=' |wc -c) Before upgrading (I don't know from wich version to the last one) it was working well

pablitok avatar Jun 08 '24 21:06 pablitok

Hi, I'm having a similar issue but my token is 224 chars long (checked with echo 'aas_et/.....=' |wc -c) Before upgrading (I don't know from wich version to the last one) it was working well

me too my token have 224 chars long

philou669 avatar Jun 09 '24 18:06 philou669

Probably we should relax this check a bit, feel free to submit a PR. You will need to check that your token indeed works.

KapJI avatar Jun 09 '24 19:06 KapJI

Probably we should relax this check a bit, feel free to submit a PR. You will need to check that your token indeed works.

how I can check if my token works

Sans titre

philou669 avatar Jun 09 '24 19:06 philou669

how I can check if my token works

You need to modify glocaltokens library here: https://github.com/leikoilja/glocaltokens/blob/master/glocaltokens/utils/token.py

And install modified version in order to test it.

KapJI avatar Jun 09 '24 19:06 KapJI

I found that it says Token must be exactly 223 characters long, which is not the same as my token. Finally, I discovered that the token I copied had an EOL (end-of-line) character. After removing it, I successfully logged in. Thanks for your help 😄

e1018e1018 avatar Jul 11 '24 10:07 e1018e1018