Can't link to partner connection

1.8k views Asked by At

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.

3

There are 3 answers

2
zonak53 On BEST ANSWER

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.

1
Greg On

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.

0
R.D. On

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.