Gilles van den Hoven avatar image
Gilles van den Hoven asked

Smart home account link error (debug followed)

Skill ID: amzn1.ask.skill.f1cb0f2a-9545-414e-8a02-2112895c82de

Followed steps here:

I have my own custom oauth2 endpoint.

  1. From amazon -> -> Saves Amazon redirect_uri and State parameter and fwds to Google signin.
  2. Google goes back to where i send the token from google to Amazon redirect_uri, including state.
  3. Amazon contacts for a token Above steps are working for custom skill, but fail for smart home skill.

note: since the client_id, client_secret and scope which i send to Google are being sent from my own domain i have dummy values at my skill since they get overwritten anyway.

Step 1 - From Amazon towards

array (
  'client_id' => '...',
  'response_type' => 'code',
  'state' => '...',
  'scope' => '...',
  'redirect_uri' => '',

Then i save the state and redirect_uri in a session and redirect to Google.

Step 2 - From Google back to

array (
  'code' => '...'

I redirect back to the redirect_uri from the original request, appending state and code.

Step 3 - From Amazon to

array (
  'grant_type' => 'authorization_code',
  'code' => '...',
  'redirect_uri' => '',
  'client_id' => '...',

Step 3.1 - From towards Google to exchange the code for an access_token and refresh_token

array (
  'grant_type' => 'authorization_code',
  'client_id' => '...',
  'client_secret' => '...',
  'code' => '...',
  'redirect_uri' => '...',

Step 3.2 - Do magic towards Google

I get a correct response from Google and send this back to Amazon.

headers returned:

header('content-type: application/json');
header('cache-control: no-store');
header('pragma: no-cache');

body returned:



An error occurred while attempting to link Alexa with <skillName>. Please try again later.

Any tips? I have 2 observations:

  1. This exact same flow works for my (other) custom skill.
  2. I am conforming towards the oAuth2 response.
skillalexa smart homeaccount linkingredirect
10 |5000

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

0 Answers