Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error creating new user #266

Open
Destructorxdx opened this issue Mar 5, 2022 · 16 comments
Open

Error creating new user #266

Destructorxdx opened this issue Mar 5, 2022 · 16 comments

Comments

@Destructorxdx
Copy link

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]

@caj380
Copy link

caj380 commented Mar 6, 2022

I am having the exact same issue on 4.0.0 dev

@jiffyjaff
Copy link

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.

@jiffyjaff
Copy link

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

@techtom609
Copy link

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

@jiffyjaff
Copy link

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

@techtom609
Copy link

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.

@jiffyjaff
Copy link

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.

@sourworm
Copy link

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

@techtom609
Copy link

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

@caj380
Copy link

caj380 commented Mar 13, 2022

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

@joeyx22lm
Copy link

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

@dotrooster
Copy link

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..."

@catherineVoo
Copy link

Sadly this solution is not working anymore :(

@jmpavlec
Copy link

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)

@nerdyninny
Copy link

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

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

@Nephiel
Copy link

Nephiel commented Aug 4, 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests