3

I'm having trouble authorizing an account after following the steps listed at: https://developers.google.com/nest/device-access/get-started

The steps are:

  1. Register for the Device Access program >> Paid using a private account
  2. Activate a supported Nest device with a Google account. >> I can see my Nest devices when signing in to Google home or Nest using my private Google account.
  3. Create a Google Cloud Platform (GCP) project to enable the SDM API and get an OAuth 2.0 client ID. >> Used the "Enable the API and get an OAuth 2.0 Client ID" button and inserted the redirect URL when prompted. Verified everything looks right in the GCP console.
  4. Create a Device Access project to receive a Project ID. >> Used the OAuth client ID from step 3 when setting up

Used this URL to try and get an authorization code:

https://nestservices.google.com/partnerconnections/project-id/auth?
redirect_uri=https://www.google.com&
access_type=offline&
prompt=consent&
client_id=oauth2-client-id&
response_type=code&
scope=https://www.googleapis.com/auth/sdm.service

Yes, I replaced the project ID with that from the Device Access Console and the OAuth Client ID from Step 3. I select the Google account from steps 1 and 2.

I still get the error message in the browser that says:

Can't link to [project name]

I never get prompted to Allow the project to access my Google account (steps 3-5 here).

Thanks for the help.

zonak53
  • 54
  • 7
  • I had the same issue, and it went away after deleting the Device Access Console project and the GCP project. I'm not sure if I just needed to try again or if I did something differently, but I think the first time I created the Device Access Console project first, then the GCP one (adding the OAuth ID later), while with the second I created the GCP one first and entered the OAuth ID when creating the Device Access Console one. – Nathaniel Verhaaren Oct 07 '20 at 02:29
  • @NathanielVerhaaren - Wish I was that lucky! I tried new projects in device access and GCP created through the Getting Started, but also separately through each tool. If there's a detail I'm missing, not sure where it is. Probably in GCP since there are not many options in DAC. – zonak53 Oct 07 '20 at 13:11

3 Answers3

0

When you use the built in copy function on the Google page, it copies this code:

https://nestservices.google.com/partnerconnections/project-id/auth?
redirect_uri=https://www.google.com&
access_type=offline&
prompt=consent&
client_id=oauth2-client-id&
response_type=code&
scope=https://www.googleapis.com/auth/sdm.service

But when you past into the browser there are spaces after each &. So you need to manually delete the spaces to actually use the right URL.

zonak53
  • 54
  • 7
  • i have not experienced this copy/paste issue so it should not be viewed as a solution. – Greg Oct 21 '20 at 01:37
  • 1
    @Greg Since this was the exact thing that solved my problem, it was most certainly the solution. You do highlight the fact that the error from Google is not helpful. I suspect you're having a different issue but getting the same error message. At least when you get the API running there are error codes. It's still an error in my browser (just checked). I'm using Safari 12.1.2, but you might not have this error in a different browser. – zonak53 Oct 22 '20 at 02:59
0

Order of operations seems to matter here. I ran into the same error as you, but it was after creating the Device Access project prior to creating the API credentials in GCP.

After deleting my project from the Device Access Console and re-creating it, it worked fine. I used the same API credentials in both cases.

Greg
  • 2,559
  • 4
  • 28
  • 46
0

I ran into this issue and I figured it out. The crux of the issue is that the OAuth client ID in https://console.nest.google.com/device-access/project/$PROJECT_ID/information must be the name. Note that it's typically empty after you create the project. This is because you create the OAuth Client after the Project in the step is Getting Started.

Additionally, in the OAuth Client's Redirect URIs, whitelist https://www.google.com while setting up. You can delete this later.

R.D.
  • 2,471
  • 2
  • 15
  • 21