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

Can't authenticate - invalid redirect_uri #291

Open
kwilkins-82 opened this issue Apr 21, 2022 · 6 comments
Open

Can't authenticate - invalid redirect_uri #291

kwilkins-82 opened this issue Apr 21, 2022 · 6 comments

Comments

@kwilkins-82
Copy link

kwilkins-82 commented Apr 21, 2022

I've been through the Client ID and project set up steps, and I'm trying to connect using the following command:

google_nest --project_id="${PROJECT_ID}" --client_id="${CLIENT_ID}" --client_secret="${CLIENT_SECRET}" list_structures

After navigating to the provided URL, I can log in OK but I get an error after selecting devices - complaining the redirect_uri is not valid for a Web Service.

Authorization Error
Error 400: redirect_uri_mismatch
The redirect URI in the request, urn:ietf:wg:oauth:2.0:oob, can only be used by a Client ID for native application. It is not allowed for the WEB client type. You can create a Client ID for native application at https://console.developers.google.com/apis/credentials/oauthclient
[Learn more](https://developers.google.com/identity/protocols/oauth2/openid-connect#setredirecturi)

I tried setting it up as a Desktop Application instead as suggested - but that didn't work either giving the following error:

Authorization Error
Error 400: invalid_request

You can't sign in to this app because it doesn't comply with Google's OAuth 2.0 policy for keeping apps secure.

You can let the app developer know that this app doesn't comply with one or more Google validation rules.
Request Details
The content in this section has been provided by the app developer. This content has not been reviewed or verified by Google.
If you’re the app developer, make sure that these request details comply with Google policies.
redirect_uri: urn:ietf:wg:oauth:2.0:oob
@allenporter
Copy link
Owner

Hi, Google has deprecated this method of authentication for new signups. I'm in active discussion with their developer relations on a new approach. See home-assistant/core#67662 for more context

@kwilkins-82
Copy link
Author

The issue seems to now be resolved for home-assistant. Will the same fix work for this project?

@allenporter
Copy link
Owner

The reason it works with home assistant is because they have a http server endpoint to get the redirect url.

Basically, you're own your own to get the auth credentials, and we'll likely need to delete the code for this in the command line tool.

@newadventure079
Copy link

I'm a new user to this library and am also seeing this error. Does this mean we can't use this library until this is resolved? Are there any workarounds?

@allenporter
Copy link
Owner

You likely can't use the command line tool anymore with desktop auth. You can use web auth, but you have to write your own oauth integration to get the access token..or maybe you could use a service account.

@allenporter
Copy link
Owner

Probably the best next step for this is make the command line took work with a service account.

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

3 participants