Melvin-Abraham / Google-Assistant-Unofficial-Desktop-Client

A cross-platform unofficial Google Assistant Client for Desktop (powered by Google Assistant SDK)
Apache License 2.0
3.61k stars 409 forks source link

[🐛 Bug]: Issue with authentication and device registration #765

Open cburgard opened 2 years ago

cburgard commented 2 years ago

What went wrong?

I was trying to install and setup the app. However, none of the suggested methods worked out of the box.

Version 1: Creating a device registration via the suggested webpage

I tried to follow the instructions under https://github.com/Melvin-Abraham/Google-Assistant-Unofficial-Desktop-Client/wiki/Setup-Authentication-for-Google-Assistant-Unofficial-Desktop-Client This worked up until the point where the JSON is fed into the client. It would then refuse to continue, the issue being this one here: https://github.com/Melvin-Abraham/Google-Assistant-Unofficial-Desktop-Client/issues/671

Version 2: JSON "Web client (auto created by Google Service)"

I tried to create the JSON using the "Web client" method suggested in the issue mentioned above. This worked in so far as the client would now continue to the OAuth step. However, upon trying to obtain the code from the OAuth link, the Browser would leave me with this message:

Unable to process request due to missing initial state. This may happen if browser sessionStorage is inaccessible or accidentally cleared.

This persisted across multiple browsers and devices.

Version 3: Console method

In an act of desparation, I followed the instructions here: https://developers.google.com/assistant/sdk/reference/device-registration/register-device-manual

The pip install command left me with this message:

ERROR: Error while checking for conflicts. Please file an issue on pip's issue tracker: https://github.com/pypa/pip/issues/new
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/pip/_internal/commands/install.py", line 585, in _determine_conflicts
    return check_install_conflicts(to_install)
  File "/usr/lib/python3.10/site-packages/pip/_internal/operations/check.py", line 110, in check_install_conflicts
    check_package_set(
  File "/usr/lib/python3.10/site-packages/pip/_internal/operations/check.py", line 85, in check_package_set
    if not req.specifier.contains(version, prereleases=True):
  File "/home/cburgard/.local/lib/python3.10/site-packages/pkg_resources/_vendor/packaging/specifiers.py", line 728, in contains
    item = parse(item)
  File "/home/cburgard/.local/lib/python3.10/site-packages/pkg_resources/_vendor/packaging/version.py", line 49, in parse
    return Version(version)
  File "/home/cburgard/.local/lib/python3.10/site-packages/pkg_resources/_vendor/packaging/version.py", line 264, in __init__
    match = self._regex.search(version)
TypeError: expected string or bytes-like object

However, I decided to continue anyway, first passing the JSON obtained in the previous step (Version 2). This left me with this message:

Fehler 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

Version 4: Native web application

Following the link provided there, I was able to create a JSON file and download it. I would again perform the OAuth step using the "Console method" of calling "google-oauthlib-tool", and this time, it would succeed to the point where it would try and display the code.

However, the webpage displaying the code was just an empty directory listing of localhost, but fortunately, the code was displayed as part of the URL (code=ABCDEF...)

With this, I was finally able to authenticate my Google Assistant

What did you expect to happen?

The documentation should contain viable instructions how to register the app.

Please either fix the implementation or update the README.

Steps to reproduce the bug

Follow the instructions on the README to register a new installation on archlinux (using the google-assistant-unofficial-desktop-client-bin package from the AUR).

App Version

Built from source

OS Version

Archlinux

Relevant Assets

No response

Pre-submission Checklist

im-coder-lg commented 2 years ago

@cburgard, you can try this method. Although it has been getting some problems as of late, it worked for me even after an OS switch. If you get some more weird things, try checking #671 if it's related to tokens, there is a comment on how to fix this at that issue.

Melvin-Abraham commented 1 year ago

Hi @cburgard, keeping this issue in mind a new version was released (v1.1.0) along with an updated guide. Refer Configure Credentials Guide.

PS: Also, it seems like the AUR package is not in sync with the latest version as it's being maintained by a third-party. So, you may consider other sources.