question

newuser-81707400-a5a9-4d0b-9c8d-285cbd6b95cf avatar image

https://forums.developer.amazon.com/questions/232750/app-to-app-account-linking-and-skill-activation-in.html?childToView=234153#answer-234153

https://forums.developer.amazon.com/questions/232750/app-to-app-account-linking-and-skill-activation-in.html?childToView=234153#answer-234153

I was following this link :

my question is :

Hi Team,


did we get any soultion for this, 3rd step ProfileAuthCode working for me in final account linking, but why I need to login on LWA two times, I already looged in once to get aut code first time.


Please help.


How I can use same auth code for both case or even login 2nd time, how I can get auth code again for LWA.


alexa skills kit
10 |5000 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

Hello there,

App to App account linking is designed to use with developers own authorization server (not LWA) either in their app or web app. This means if you have your own app you should have your own login mechanism where user has to login to get into your app. Once user logged in you have user auth code and access token with you.

After this now call for Alexa app using universal link and if this doesn't work (when user didn't installed Alexa app) then LWA will be called as fallback url.

Once user successfully launched Alexa app/ LWA url this will create amazon authorization code and redirects to your app/web app.

Now, using this amazon auth code and user auth code received in first step you are call skill activation API.

So overall, you only have to LWA login once if your Alexa app is not installed and you have you own login setup.

LWA login will be twice only when you used LWA login to login into your app and doesn't have Alexa app installed in your device.

Let me know if you have any further confusion in this feature.

10 |5000 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.

newuser-81707400-a5a9-4d0b-9c8d-285cbd6b95cf avatar image
newuser-81707400-a5a9-4d0b-9c8d-285cbd6b95cf answered

Thanks @Anand@Amazon this work for me but when ,


I created my own oauth2.0 authorization server and that working fine too when I do the setup local and do the account linking as well.

but whenever I deployed my war on ec2 instance on tomcat , all functionality working except account linking part,

whenever I am calling this api, getting below error :

accountLinkResturl-->https://api.eu.amazonalexa.com/v1/users/~current/skills/amzn1.ask.skill.f3b81232-e9ba-42ad-b36f-2d355e324836/enablement

400 Bad Request: [{"message":"Could not contact provider of account linking credentials"}]

org.springframework.web.client.HttpClientErrorException$BadRequest: 400 Bad Request: [{"message":"Could not contact provider of account linking credentials"}]


its looking like alexa api internally not able to reach my /oauth/token call and that's why I am getting this error.

When I call this url with postman , /oauth/token i am able to get access token as well, but not sure what happening in cloud side why its not reachbale to /oauth/token via alexa


18591-capture.png (24.5 KiB)
10 |5000 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 there,

Do you still get error on your end?

1 comment
10 |5000 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.

i had the same problem
0 Likes 0 ·