Skip to content

Setup Authentication for Google Assistant Unofficial Desktop Client

Melvin Liji Abraham edited this page Jan 1, 2023 · 11 revisions

Device Registration

  1. Head on to Actions Console

  2. Click on the "New Project" button

    Actions Console

  3. You will see a "New Project" popup. Enter any project name and set other options accordingly and click on "Create Project button"

    Add Project

  4. Now, after your project is created, you will see the "onboarding" page. Just scroll to the bottom and click on the "click here" link right after the text "Are you looking for device registration?" to proceed to Device Registration

    Onboarding Page

  5. Wait until your project is created...

    Creating Project on Actions Console

  6. Now, you will be landed in the "Device Registration" page. Here, click on "Register Model" button

    Device Registration Page

  7. You will see a "Register Model" popup, fill all the details and for device type, select any (eg: light). Then, finally click on "REGISTER MODEL"

    Register Model

  8. Now, after you have created a model, you will be asked to download the credentials. Skip this by clicking on Next.

    Download Credentials

Now, you are done with the registration process. But in order to authenticate, you have to "Configure Consent Screen"

Configure Consent Screen

  1. Head on to Cloud Console

  2. In the Navbar beside the logo, click on the button to select a project

    Select Project in Cloud Console

  3. You will see a popup titled "Select a project". Click on the "ALL" tab and select the name of the project you just created. Then, press OPEN to continue

    Select Project Popup

  4. Now, from the hamburger menu, select "APIs & Services"

    APIs and Services Menu

  5. Click on "ENABLE APIS AND SERVICES"

    Enable APIs and Services Button

  6. You will be landed in "API Library"

    API Library

  7. In the search bar, type "Google Assistant" and click on "Google Assistant API"

    API Library Search

  8. Press "ENABLE" button to enable the API

    Enable API

  9. Wait until the API is enabled

  10. Now, from the hamburger menu, click on "Credentials"

  11. Click on the "CONFIGURE CONSENT SCREEN"

    Credentials Tab

  12. In the OAuth Consent Screen under User Type, select External. Then, click CREATE

    OAuth User Type

  13. In the next page, under "App Registration" select your email for "User Support email"

    Select Support E-Mail

  14. Scroll down to the bottom of the page. Under "Developer Contact Information", fill in your email address for "Email addresses" and click on SAVE AND CONTINUE

    Fill Developer Contact E-mail address

  15. Now skip the "Scopes" screen by clicking on SAVE AND CONTINUE

    click on "save and continue" to skip "Scopes" screen

  16. Under "Test Users" click on "ADD USERS" button

    Add users under "Test Users"

  17. Under "Add Users", type the email address of the Gmail account that you will use to authenticate (preferably your current Gmail account). You can add multiple Gmail accounts by adding a comma after each of the Gmail accounts.

    Type Gmail account email address for authentication

Configure Credentials

  1. Select Credentials from the sidebar. Then, under the OAuth 2.0 Client IDs, click on Web Client to edit the web client credentials.

    Credentials Page

  2. Update the redirct URI under the Authorized redirect URIs section to:

    http://localhost:5754/auth/handler
    

    Updated Redirect URI

  3. Now, click on Save. This will redirect you back to the credentials page.

  4. Click on Web Client again in order to reset the client secret.

  5. Click on Reset Secret on the top. This will display a popup for confirmation. Click on Reset to confirm.

    Reset Client Secret

  6. Click on Save again.

  7. Now, click on the download button against Web Client

    Credential Download Button Click

  8. This will open a popup dialog. Click on Download JSON button. This is your OAuth 2.0 Credential.

    Credential Download Dialog Popup

Setting authentication in the app

  1. Run and launch the Google Assistant Unofficial Desktop Client app

  2. Click on the "Settings" button in the top-left corner of the application

  3. Under the "Authentication" section, set the "Key File Path" to the path where you have kept the "OAuth 2.0 Credentials" and leave the "Saved Tokens Path" empty. Now click on "Save" button

    Authentication: Set Key File Path

  4. You will be prompted to automatically create a path for "Saved Tokens Path". Click on "Automatically set a path"

    Automatically set a Saved Tokens Path

  5. You will be asked to reload the Assistant. Click on "Relaunch Assistant" button

    Relaunch assistant

  6. Now, you will be presented with the "Get Token!" screen. An authentication page will be opened in your default browser

    Get Tokens screen

  7. Select the preferred Gmail account to authenticate

    Choose Gmail account to authenticate

  8. You might come across the following warning: "Google hasn't verified this app". Since the project is created by you, this should be safe to proceed with. Click on "Continue"

    "Google hasn't verified this app" warning screen

  9. Now grant permission to the project by clicking on "Continue"

    Project Permission

  10. You will now be presented with the authorization code screen. Click on the copy button

    Authorization Code Screen

  11. Switch to the application and paste the code in the respective field. Now click on "Submit"

    Paste Authorization Code

  12. You will be prompted to relaunch the app again. Click on "Relaunch Assistant"

Now, you are all set! You can finally use the Google Assistant Unofficial Desktop Client and customize it the way you want... 😉

Enabling Personal Results (Optional)

Personal results are results that are fetched from Google Services like Gmail, Google Calendar, Google Photos, etc. These results are not shown by default as they might be part of user activity and personal data. If you want the assistant to show you your personal results when asked for it, you must explicitly enable it. Below are the steps to help you enable personal results.

  1. Once your assistant app is ready to use after having followed the proper steps, you must ask the assistant specific queries to trigger personal results. For example, "What's my name?", "Show me my photos" or "What's on my calendar next?".

    Trigger Personal Result Query

  2. As mentioned in the above screenshot, you might receive a notification on your phone to turn on personal results. Tap on the notification.

    Allow Personal Answers - Phone Notification

  3. You will come across a screen like the one below. Tap on "Device Name". (Do not toggle Personal Results right away)

    Allow Personal Answers - Initial Screen

  4. Now, enter any device name, say, "G Assist" and tap on "OK".

    Allow Personal Answers - Device Name Prompt

  5. After the device name has been set, tap on "Personal Results" to enable personal results.

    Allow Personal Answers - Personal Results Toggle

That's it. Now, you can ask the assistant to show your personal results. If you are still prompted to allow personal results, that probably means that personal results could not be enabled in your current project. In this case, you might have to start afresh and create a new actions project if you want to enable this feature.

Experiencing an issue?

You can check out the Frequently Asked Questions (FAQ).

Other References

Device Registration using UI:

Device Registration using Command Line Tool: