question

Gauravpant avatar image
Gauravpant asked

Unable to link account for Smart Home Skill

I am trying to build the native skill for Smart Home Skill and as a first step trying to test the account linking using Oauth2 authentication .

The type of authentication we are using is authorization code grant as this is must for the Smart Home skill.

However, the account linking is not successful and is failing despite the steps followed from the Amazon’s OAuth2 documentation.


(https://developer.amazon.com/docs/account-linking/understand-account-linking.html)


As per the documentation this authorization involves 2 steps as below and looks like 2ndstep is failing somewhere from amazon .


  1. The authorization server must be able to accept the required parameters, authenticate the user, generate an authorization code, then redirect the user to the Amazon-provided redirect_uri.


This step looks OK and we are able to generate the code and redirecting it to one of the amazon’s whitelisted URI

("https://pitangui.amazon.com/api/skill/link/MWWTGLYBNT37J?code=<code>&state=<state>“)


  1. The access token URI must accept client credentials and the authorization code and return an access_token (and optionally, a refresh_token that can be used to get a new access_token in the future) for the user.


As per the logs in our server we are generating it correctly but for some reason amazon is throwing error of not able to link the account.

We are returning something like below for the token (refresh token is optional , so we tried with or without referesh token with no luck)


{

"token_type": "bearer",

"access_token": "ugD8ma58T8v9J7k4EZUPokOyiTh87/PBR2qmSiL0bj7Xxp73pVrUDVeSsyzIMXdh",

"refresh_token": "ugD8ma58T8v9J7k4EZUPokOyiTh87/PBR2qmSiL0bj7Xxp73pVrUDVeSsyzIMXdh",

"expires_in": 3600

}


Skill Id: amzn1.ask.skill.ec47e193-e812-4334-bc56-ae92e110553b

Skill Name: AlphaSmartCam

Account Info: 15087912781/password1


Is there a way amazon can track the logs and share it to see what’s going wrong here ?


Please note this is being tested from local environment(Authorization URI & Access Token url https is supported with ngrok support)


Thanks,

Gaurav


alexa skills kitaccount linkingsmart home
10 |3000 characters needed characters left characters exceeded

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

Anand@Amazon avatar image
Anand@Amazon answered

Hi Gaurav,

I tried with provided credentials but getting error "No account found for that phone number and password."

I will suggest you to raise your issue here and provide all correct details including credentials to deep dive your issue.

10 |3000 characters needed characters left characters exceeded

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

Gauravpant avatar image
Gauravpant answered

I have sent the details in the link you shared .

Please see the below information to simulate the issue in the amazon.

However, the account linking is not successful and is failing despite the steps followed from the Amazon’s OAuth2 documentation.

(https://developer.amazon.com/docs/account-linking/understand-account-linking.html)

1) Go To AlphaSmartCam skill for Ooma

2) Use the account linking from the alexa.amazon.com with credentials

Skill Id: amzn1.ask.skill.ec47e193-e812-4334-bc56-ae92e110553b

Skill Name: AlphaSmartCam

Please let us know what's going wrong there

1 comment
10 |3000 characters needed characters left characters exceeded

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

Hi Gaurav,

Please don't share account credentials here as this is a public developer forum. I have removed your credentials from your previous response.

I checked your skill and got the same error while doing account linking. You are getting this error because you have enabled "Alexa event gateway" but not using accept grant in your skill.

You need to implement Alexa.Authorization interface in your skill.

0 Likes 0 ·