[Solved] Token Problem [Google Server Problem]
-
hello I have a token problem. I do the installation and configuration but at the end when I do npm run tokens i have an message error like this:
/home/pi/MagicMirror/modules/MMM-GoogleAssistant/node_modules/@bugsounet/google-assistant/components/auth.js:26
const oauthClient = new OAuth2Client(key.client_id, key.client_secret, key.redirect_uris[0]);
^TypeError: Cannot read properties of undefined (reading ‘0’)
at new Auth (/home/pi/MagicMirror/modules/MMM-GoogleAssistant/node_modules/@bugsounet/google-assistant/components/auth.js:26:91)
at new GoogleAssistant (/home/pi/MagicMirror/modules/MMM-GoogleAssistant/node_modules/@bugsounet/google-assistant/index.js:33:18)
at Object.<anonymous> (/home/pi/MagicMirror/modules/MMM-GoogleAssistant/installer/auth_GoogleAssistant.js:55:19)
at Module._compile (node:internal/modules/cjs/loader:1103:14)
at Object.Module._extensions…js (node:internal/modules/cjs/loader:1155:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47Done.
I don’t know why i have this error, my token file is in the good repertory and it’s call credentials.json. Please someone can help me thank you.
-
Hi, I think it’s a bad credentials
try to download it againActually, in your credentials file, there is no redirect_uris
-
@bugsounet okay i will try to download again the file thank you
-
@bugsounet I do it and it’s work but i have an other problem for log me to google it’s say error 400 : invalid_request “redirect_uri: urn:ietf:wg:oauth:2.0:oob”
-
hello bugs, I am also getting the same error400 invalid request error, please help me removing this and get the token update for me
-
@talha-ahmii said in Token Problem:
hello bugs, I am also getting the same error400 invalid request error, please help me removing this and get the token update for me
-
Hello, hope i am not out of turn jumping on this thread but i had the same issue and resolved it this way:
Replace urn:ietf:wg:oauth:2.0:oob with http://localhost:1/ in the credentials json file, re-run npm run tokens, the url now works, enter the project email address and password, this will error at some point BUT it gives you the auth code to paste into your token shell screen, press enter, it will then ask you to put in your request, just ignore that. Restart magic mirror and the GA assistant module should work as expected now
Bit of a dirty fix but it works. -
@paul_4238 thank you very much it’s work 🥳
-
it works thank you so much
-
Hi, I will make new tutorial and testing
I think your method is not good because it can’t refresh token
I have to release v4 but I will fix this tutorial before
-
@bugsounet okay thank you very much
-
@bugsounet I totaly agree this isnt a good fix but it was frustrating me because of the error.
Look forward to your updated tutorial and keep up the great work, respect -
First things to know …
- I have download the credentials sended by the registration device but it not works …
I inspect the sended json file, some part is missing (very strange… Google bug !?)
const oauthClient = new OAuth2Client(key.client_id, key.client_secret, key.redirect_uris[0]);
^
TypeError: Cannot read properties of undefined (reading ‘0’)redirect_uris is missing in credentials …
So I don’t use it !- So i Go to the console cloud
I try to download and test some available OAuth 2.0 file result the same OR error 400
Naturally … like wiki says … I have publish my app
That I have read on the message of Error 400: now google have to VALIDATE if you publish your app…
So i return to consent screen:
I unpublish my app and return to TEST mode
I have enter my email Adress for add me to beta testeur of this app
I download again the credential associated to the registred deviceI test … and works
Now I have publish the app and waiting… (if token will refresh ~7 jours waiting)
I don’t really know what google really want …
I will inspect more tomorow (maybe, it will be related with consoleactions) - I have download the credentials sended by the registration device but it not works …
-
Add your mail of your account
-
Hello and thank’s for all of your work, I was trying to get the token but I receive localhost conection rejected, can you tell me what im doing wrong?
I unpubished my project and also added my email for testing. -
Salut à tous
j’ai rentré le token GA sans problème.
mais j’ai une erreur code 409 sur npm run register.
request failed with status code 409.
et je n’arrive pas à trouver la solution , une aide ou une piste serait la bienvenue Merci d’avance -
Just remeber this:
** I don’t works in Google Compagny
** I’m just a user like you with a google account
** The developer of YOUR app in google console and google cloud is not me … it’s you
** I develop the code for use YOUR created app and device !
** I have can’t see what you have in your account
** Actually, I have old credentials (created in 3 year ago…)
** I’m not a magicien and I have NOT any reponse for this problem actually
** Like I says … I’m working arround
** bad thing is actually … repeat again , again, again the same thing …
** it’s really better to post Good thing like : I found … I make like this …Thanks for all (users)
-
@fikkiovarrikkio said in Token Problem:
And Naturally… that you don’t see …
- On the top of the blank web page
So the code is Between
code=
and&scope=
That i see, I can change the url.
I will make a web page for displaying this code in text for better copy pastLet me a couple of days for doing this … (If Google don’t change anything again…)
-
Yes Thank you very much, it worked for me, it asked me to paste the code and a request (the same code)
-
bugsounet
-
Don’t worry guy,
@2hdlockness and me will solve the problem
We are working arround.I do some test and it’s works with my account
So, @2hdlockness will make a new design (with google color) for the callback website code !
And I think, I will try to simplify the registration processI will create a new google account for testing…
I repeat again … I don’t work in google compagny, I’m a single user like YOU
So actually it’sdiscover mode
like you… but it take sense !Priority is number 1 and i Stop coding some other EXT