Failed to Authorize Link Code Please Try Again Echo Plus

Troubleshooting Mutual Account Linking Issues with Alexa Skills

Blog_Header_Post_Img

You can use account linking to connect a user's Amazon business relationship to the account that they accept with your service. For more than data on how this works, run across How Users Feel Account Linking for Alexa Skills.

This blog is a guide for developers who have just started implementing account linking, and addresses issues you might encounter during the development process, including how to troubleshoot the"We were unable to link <skill name> at this time" error, what happens when business relationship linking expires subsequently certain fourth dimension, and what to do if business relationship linking does not piece of work on sure devices.

Unable to Link the Business relationship

For the authorization code grant business relationship linking menses, 1 of the well-nigh common bug is account linking declining during the process of exchanging the dominance token for the access and refresh token. When a user starts the account linking process, the Alexa app displays a login page, which uses the authorization URI from the business relationship linking configuration in the Alexa Developer Console. Later on your authority server authenticates the user, the authorization server will generate an authorization lawmaking. The Alexa service then uses the authorization lawmaking in a POST asking to think an access and refresh token pair from your say-so server's access token URI. If Alexa cannot receive the access and refresh token pair from your authorization server, it volition display the error below.

Alexa App screenshot

Here are some tips on how to troubleshoot this error:

Cheque Authorization Server Logs

Here are some areas to check on your potency server:

  • Bank check that the say-so server is generating a valid authorization code for exchange of admission and refresh tokens.
  • Log the response from your authorization server to make certain information technology returns the access token and refresh token in a JSON response to Alexa. Make sure information technology is not sending an error or an invalid JSON response to Alexa.

If yous are using a 3rd political party OAuth server (such every bit Google Sign-In or Facebook Login) and do non have access to the services' logs, you can set upwards AWS API gateway to get access to additional logs. Cheque out the tutorial on how to set up up Amazon API Gateway as a proxy in lodge to check the JSON that is being sent to and from the Alexa service.

Bank check AcceptGrant Response

For smart home skills, you may have turned on "Send Alexa Events" permissions to send events, such as modify report events, to proactively report device states.

If the "Transport Alexa Events" permissions is on for your smart domicile skill, you need to handle the AcceptGrant directive that is sent to your skill'due south Lambda function during business relationship linking. Your skill endpoint has to respond synchronously with an AcceptGrant.Response in club to retrieve the authorisation code that is used to proactively report states.

To examination whether this is the crusade of the account linking failure, try turning off the "Send Alexa Events" permissions from Alexa Developer Panel and then testing business relationship linking. If business relationship linking at present works, then make sure your Lambda function can handle the AcceptGrant directive.

Account Linking Succeeds but the User Has to Link Accounts Again in the Future

This indicates that Alexa was unable to use the provided refresh token to recollect a new access and refresh token pair. Access tokens must have a lifetime of at least 6 minutes. Set up admission tokens with a lifetime of greater than or equal to 6 minutes or 360 seconds in the expires_in parameter. Additionally, make sure that the "Default Access Token Expiration Fourth dimension" on Alexa Developer Console is also greater than or equal to 360 seconds.
Example access token response:

Copied to clipboard

            HTTP/1.1 200 OK Content-Blazon: application/json;charset UTF-eight Cache-Command: no-store Pragma: no-cache {    "access_token":"Atza|EXAMPLEACCESSTOKEN123456...",    "token_type":"bearer",    "expires_in":360,    "refresh_token":"Atzr|EXAMPLEREFRESHTOKEN123456X..." }          

Test to see if your authorization server tin can successfully refresh the access token pair and is non invalidating refresh tokens earlier the 5 minute window of time is upward. If your authorization server has already invalidated the refresh token, Alexa will not exist able to refresh the access and refresh token pair and your customer volition accept to link their account from Alexa app again.

Account Linking Does Not Work on Certain Devices

Sometimes account linking may work on ane device, but not on some other. For example, while it may work on web browsers, it might not work on the Alexa app. This could be due to certain domains missing from the "Domain Listing" in the account linking configuration in the Alexa Developer Panel.

If your skill'due south authorization server pulls in any content from domains other than your dominance URI's domain, you will need to add those domains to your skill's configuration. You can add these under the Developer Console > Account Linking > Domain List section for your skill.

domain image

Make sure yous have added all external domains the account linking page calls or uses. This needs to include all domains to which you're making external calls. For example, if you brand a call to oauth.sample.com, simply adding sample.com isn't acceptable - you need to add oauth.sample.com.

HTTP 400 Fault during Redirect

This usually indicates there is something wrong with the redirect_uri, or that the redirect URL is invalid. Alternatively, if the request size is as well large (this includes the length of the redirect URI, combined with all the cookies for the domain), this can stop the page from redirecting correctly.

Testing in an incognito or private window and confirming that account linking succeeds would also indicate this issue. If account linking can be completed in an incognito or individual window, endeavour reducing the length of the redirect URL. Equally the redirect URL includes all of the query parameters, reducing the length of these parameters tin alleviate the problem. A common reason where redirects neglect is due to authority codes being as well long - reducing the length of authorization codes may resolve this issue.

This blog has outlined how to troubleshoot four of the virtually common business relationship linking issues. If your issue is not listed here, please cheque out the forum on business relationship linking.

Understand Account Linking for Alexa Skills

Access token URI requirements

Send Events to the Effect Gateway

Alexa.Dominance Interface

Alexa: Debugging account linking

How to Ready Amazon API Gateway as a Proxy to Debug Business relationship Linking

streicherhurew1943.blogspot.com

Source: https://developer.amazon.com/en-US/blogs/alexa/alexa-skills-kit/2020/12/troubleshooting-common-account-linking-issues-with-alexa-skills

0 Response to "Failed to Authorize Link Code Please Try Again Echo Plus"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel