greghesp/assistant-relay

Error creating new user

Destructorxdx opened this issue ยท 16 comments

Describe the bug
I'm having trouble registering the ID of OAuth 2.0 clients

To Reproduce
Steps to reproduce the behavior:

  1. Register a new account
    image

  2. Click Next

  3. The error will be displayed when registering the OAuth 2.0 client
    image

Expected behavior
Show code to register account

Screenshots
image

Desktop (please complete the following information):
-Platform [Windows]
-Browser [chrome]
-Version [latest]

I am having the exact same issue on 4.0.0 dev

I don't think this problem is related to the assistant-relay code.

I just followed Google-published instructions using python dev libraries to authenticate the assistant and received the same error posted above. I think something is broken on Google's end. The part of the URL that contains redirect_uri params matches the format in the error message.

https://developers.google.com/assistant/sdk/guides/service/python/embed/install-sample

We should report this but I'm not sure how.

Google support advised me to report the issue on Stack so I've done that. Still awaiting a response.

https://stackoverflow.com/questions/71385860/generating-credentials-auth-error-redirect-uri

This is what i found so far not sure if I'm on the right path but here's what I got.

I think the issue is related to Making Google OAuth interactions safer by using more secure OAuth flows

1
2
3

Based on what you found, my guess is that this library is to blame ...

https://www.npmjs.com/package/google-auth-library

AR is using version 5.10 and the latest version is 7.14 which probably contains the OOB update that got blocked on Feb 28th 2022...

shit well that really sucks I rely on AR for a shit load of automations. Plus the add-on isn't being updated anymore by the developer so not really sure what our next step here would be but you're right that change is most likely the issue.

I found a workaround for creating a new user. In my case, I needed to create a specific type of API credential. Here is what I did:

Create a new OAuth Client credential using the link below, ensuring the application type is "Web application" and set Authorized Redirect URIs to "http://localhost"

https://console.cloud.google.com/apis/credentials

Download the key, and create the user in the Assistant Relay appas you tried before. When it opens a new browser window to authorize the google account, you might need to bypass a warning. After you do this, a blank browser window will open but the address bar will contain the auth code you need. Grab the code from the relevant part of the URL here and paste it back into the Assistant Relay app:

http://localhost/?code=**COPYCODEFROMHERE**&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fassistant-sdk-prototype

Let me know if this works. I am successfully sending commands to the Assistant Relay server but nothing is playing on my speakers.

@jdtoth Nice work!
That approach worked for me. I started with a fresh install of Assistant Relay into Home Assistant then added the new OAuth credential and ran through the setup getting the auth code as you described. I used the built-in Sandbox to successfully turn on a light and also broadcast a message.

WOOT WOOT WOOT!! IT WORKED!!! Fucking amazing workaround my man!!!! I cannot thank you enough for figuring that out!!! My smart home just wasn't the same without this feature and having it back just makes my fucking day!!!

@jdtoth It worked! Thank you!!!
One thing to note: In the json credential file, I had to change {"web": to {"installed": for Assistant Relay to accept it. After doing that, it worked like a charm!

Hmm -- this is not working for me @jdtoth :/

THANK YOU @jdtoth!!!

@joeyx22lm, the first time I tried this, it didn't work so I tried again and noticed that a "/" was being converted to "%2F" in the code. I changed the "%2F" back to a "/" and it worked. Is that maybe why yours isn't working?

To clarify, the beginning of my authorization code went from "4%2F0AX..." to "4/0AX..."

Sadly this solution is not working anymore :(

I found a workaround for creating a new user. In my case, I needed to create a specific type of API credential. Here is what I did:

Create a new OAuth Client credential using the link below, ensuring the application type is "Web application" and set Authorized Redirect URIs to "http://localhost"

https://console.cloud.google.com/apis/credentials

Download the key, and create the user in the Assistant Relay appas you tried before. When it opens a new browser window to authorize the google account, you might need to bypass a warning. After you do this, a blank browser window will open but the address bar will contain the auth code you need. Grab the code from the relevant part of the URL here and paste it back into the Assistant Relay app:

http://localhost/?code=**COPYCODEFROMHERE**&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fassistant-sdk-prototype

Let me know if this works. I am successfully sending commands to the Assistant Relay server but nothing is playing on my speakers.

This worked perfectly for me just now (May 10th, 2022)

This worked perfectly for me just now (May 10th, 2022)

this worked for me as well, 7/31/2022

FWIW I successfully got this working today (as the Home Assistant addon to be precise) using @jdtoth's workaround of grabbing the auth code from the browser URL bar.

I had the same issue as @caj380, just the other way around: my OAuth 2.0 Client ID was of type Desktop instead of Web Application, and I had to replace "installed" with "web" in the credentials JSON file to get Assistant Relay to display the Auth code input box.