Bugsounet Coding

    • Register
    • Login
    • Search
    This Forum is now reserved to registred users!

    [Solved] Token Problem [Google Server Problem]

    Issues
    9
    24
    683
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • N
      NemDeFrance last edited by bugsounet

      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:47

      Done.

      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.

      1 Reply Last reply Reply Quote 0
      • bugsounet
        bugsounet Main Coder last edited by

        Hi, I think it’s a bad credentials
        try to download it again

        Actually, in your credentials file, there is no redirect_uris

        N 2 Replies Last reply Reply Quote 0
        • N
          NemDeFrance @bugsounet last edited by

          @bugsounet okay i will try to download again the file thank you

          1 Reply Last reply Reply Quote 0
          • N
            NemDeFrance @bugsounet last edited by

            @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”

            1 Reply Last reply Reply Quote 0
            • T
              talha.ahmii last edited by

              hello bugs, I am also getting the same error400 invalid request error, please help me removing this and get the token update for me

              T 1 Reply Last reply Reply Quote 0
              • T
                talha.ahmii @talha.ahmii last edited by

                @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

                Screenshot 2022-03-11 215949.png

                1 Reply Last reply Reply Quote 0
                • P
                  Paul_4238 last edited by

                  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.

                  N 1 Reply Last reply Reply Quote 0
                  • N
                    NemDeFrance @Paul_4238 last edited by

                    @paul_4238 thank you very much it’s work 🥳

                    A 1 Reply Last reply Reply Quote 0
                    • T
                      talha.ahmii last edited by

                      it works thank you so much

                      1 Reply Last reply Reply Quote 0
                      • bugsounet
                        bugsounet Main Coder last edited by

                        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

                        N P 2 Replies Last reply Reply Quote 0
                        • N
                          NemDeFrance @bugsounet last edited by

                          @bugsounet okay thank you very much

                          1 Reply Last reply Reply Quote 0
                          • P
                            Paul_4238 @bugsounet last edited by

                            @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 🙂

                            1 Reply Last reply Reply Quote 0
                            • bugsounet
                              bugsounet Main Coder last edited by bugsounet

                              First things to know …

                              1. 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 !

                              1. 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 device

                              I 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)

                              1 Reply Last reply Reply Quote 0
                              • bugsounet
                                bugsounet Main Coder last edited by

                                Add your mail of your account 😉

                                1 Reply Last reply Reply Quote 0
                                • S
                                  santo_love last edited by

                                  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.

                                  1 Reply Last reply Reply Quote 0
                                  • R
                                    Romauba22 last edited by

                                    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

                                    1 Reply Last reply Reply Quote 0
                                    • bugsounet
                                      bugsounet Main Coder last edited by

                                      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) 😉

                                      1 Reply Last reply Reply Quote 0
                                      • bugsounet
                                        bugsounet Main Coder last edited by

                                        @fikkiovarrikkio said in Token Problem:

                                        2022-03-18-012615_1787x765_scrot.png

                                        And Naturally… that you don’t see …

                                        • On the top of the blank web page

                                        b2e04baf-f256-4b33-87ee-e703f7c00409-image.png

                                        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 past

                                        Let me a couple of days for doing this … (If Google don’t change anything again…)

                                        1 Reply Last reply Reply Quote 0
                                        • S
                                          santo_love last edited by

                                          Yes Thank you very much, it worked for me, it asked me to paste the code and a request (the same code)

                                          1 Reply Last reply Reply Quote 0
                                          • Pinned by  bugsounet bugsounet 
                                          • bugsounet
                                            bugsounet Main Coder last edited by 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 process 🙂

                                            I 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’s discover mode like you… but it take sense !

                                            Priority is number 1 and i Stop coding some other EXT

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Powered by NodeBB | @bugsounet ©2022