question

wvyh avatar image
wvyh asked

The parameters are not pass back in Amazon-provided redirect URL

I want to use Smart Home Skill to control Nest Thermostat. When I enable the skill, it directs to Authorization URL.

After logging in normal credentials, it directs to below URL:

https://pitangui.amazon.com/spa/partner/authorization-result.html?partnerFriendlyName=Set%20temperature&success=true

It must include the parameters(state and code) in the URL query string. Does anyone know What this situation means?

Account Linking

Authorization URL: https://home.nest.com/login/oauth2?client_id=7040a899-6535-41a2-xxxx-xxxxxxxxxxxx&state=STATE

Client id: 7040a899-6535-41a2-xxxx-xxxxxxxxxxxx

Access Token URI: https://api.home.nest.com/oauth2/access_token?client_id=7040a899-6535-41a2-xxxx-xxxxxxxxxxxx&code=AUTHORIZATION_CODE&client_secret=WofwvrCb8Uxxxxxxxxxxxxxxx&grant_type=authorization_code

Client Secret: WofwvrCb8Uxxxxxxxxxxxxxxx

alexaalexa smart home
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Willy L avatar image
Willy L answered

Re: "It must include the parameters(state and code) in the URL query string. Does anyone know What this situation means?"

If you're using Nest as the provider, you technically shouldn't care about this part [unless you work for Nest :)] But, in general terms, it is just the regular OAuth2 code grant type. If you're actually creating your own OAuth service provider, you need to include the original state and your generated auth code as part of the HTTP 302 redirect back to Amazon.

1 comment
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Thanks 4 the answer!

0 Likes 0 ·
wvyh avatar image
wvyh answered

Can antone please help me solve the problem? I beg you! Any response will be great.

1 comment
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

I face the same problem and get stuck...

Hope anyone can help!

1 Like 1 ·
Steve A avatar image
Steve A answered

I'm not sure I understand the question. Are you asking what it means to say that the redirect URL must include State and Code parameters?

1 comment
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Definitely! Does the redirect URL must include State and Code parameters?

How to verify whether it successfully authorizes and gets Access Token?

0 Likes 0 ·