Alexa Account Linking - Error: Account linking credentials are not valid

I've been working on setting up an Alexa skill with account linking. After obtaining the Linking Authorization Code and exchanging it for an Access Token, I attempted to input all the necessary parameters: code, access token, and skill ID into the Alexa Skill Activation API. However, every time I do so, I keep receiving an error message stating "Invalid account linking credentials."

    var clientServerOptions = {
        uri: `https://api.amazonalexa.com/v1/users/~current/skills/${SkillId}/enablement`,
        body: JSON.stringify({
            stage: "development",
            accountLinkRequest: {
                redirectUri: "https://api.amazon.com/auth/o2/token",
                authCode: req.body.code, //the code initially obtained
                type: "AUTH_CODE"
            }
        }),
        method: 'POST',
        headers: {
            'Content-Type': 'application/json',
            'Authorization': `Bearer ${req.body.access_token}` //my access token
        }
}
request(clientServerOptions, function (error, response) {
    if(error != null) {
        console.error(error);
    } else {
        console.log(response.body);
    }
    return;
});

Any suggestions on how to resolve this issue?

Answer №1

Throughout the process of setting up App-App Linking from your App, I encountered some errors that are important to be aware of in case you are facing similar issues.

Common Errors:

  1. Creating a new LWA (Login with Amazon) Profile.
    Avoid creating a new LWA profile as it is unnecessary. Instead, utilize the Alexa credentials found under the permissions tab on the skill page, as they have the appropriate scope (alexa::skills:account_linking) required for successful App-App Linking. LWA profiles do not support this specific scope.

  2. Using a development version of a live skill.
    I made the mistake of modifying the account linking section in a development version to point to a test deployment. Despite being allowed in the developer console, this setup consistently caused account linking failures, leading me to create a new skill instead.

  3. Reusing the Alexa Auth Code.
    It's crucial to note that even one incorrect request can render the Alexa Auth Code invalid.

  4. Logging into the wrong Alexa Account.
    During testing when prompted to login on the LWA screen, ensure to only use the developer credentials associated with the creation of the skill. At this stage, the skill is exclusively accessible to the Alexa developer account and no one else, including beta testers.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Switch tabs with JavaScript

I'm encountering an issue with changing tabs using JavaScript and Ajax. The script I have works when not using Ajax but fails to work properly with it. Here is the script: $(document).ready(function(){ $("#mtabs li").click(function() { ...

The SQL Server data isn't reflected in the Node chart

I decided to launch a new website where I can share some of the data stored in my SQL Server database. Utilizing jsnode, I am able to retrieve the necessary data from the database and create interactive charts using chart.js Everything seems to be workin ...

Unlocking the Secrets: Javascript Tricks for Retrieving Object Values

I have an item that contains data which I need to display. {"text": "active user active user213123 idle user234234234 loggedout userafdadf" }, To extract the content, I used the following code: Response = message.s ...

Retrieving visual information from Google Street View entity

Looking for a solution to extract imagery from the Google Street View panorama within a web page? In my program, I navigate specific routes using Google Street View's javascript API controlled by an embedded Java applet on the same page. I am seeking ...

Backing up a mongodb collection can be easily achieved with the help of express.js and Node.js

I am looking to create a monthly backup of my userdatas collection. The backup process involves: I intend to transfer the data from the userdatas collection to a designated backupuserdatas collection. A batch program should be scheduled to run automatica ...

Searching for a different method in JavaScript that can add items without duplication, as the prependTo function tends to insert multiple items

Every time my code runs successfully, a success message is generated and displayed using prependTo within the HTML. However, the issue arises when the user performs the successful action twice, resulting in two success messages being shown on the screen. ...

Transforming Uint8Array into BigInt using Javascript

I've come across 3 different ways to convert a Uint8Array to BigInt, but each method seems to produce varying results. Can someone clarify which approach is correct and recommended? Utilizing the bigint-conversion library. The function bigintConversi ...

The appropriate HTTP method to employ when managing documents within MongoDB

I've developed a fantastic web application. Each user in my system has their own MongoDB document. I'm trying to determine the best HTTP method for managing these documents. For instance, when adding an item to an array within a MongoDB document ...

Enhance your AngularJS table with a custom Javascript context menu!

In the process of developing a shift planner, I have implemented a JS context menu and am attempting to display the shifts using Angular. However, upon clicking any table cell, all cells are being updated simultaneously. Is there a workaround for this issu ...

Stop event bubbling in Vue.js for router link

I'm working with the following HTML template... <template> <li class="nav-item" style="z-index:9"> <router-link :to="link.path" @click.native="linkClick" ...

Border color options for select boxes

Currently, I am working on my first Django-bootstrap project and dealing with a select box. I am trying to customize it so that when clicked, the border of the select box and its options turns yellow, which is working well. However, there is an additional ...

13 Helpful Tips for Resolving Hydration Failure Due to Discrepancy in Custom Dropdown Display between Server and UI

Recently, I embarked on a project utilizing the latest version 13 of Next.js with its new app directory feature. As I integrated a custom dropdown into one of my pages, an error surfaced: "Hydration failed because the initial UI does not match what was ren ...

The express application's GET route is causing a "Cannot GET" error to be thrown

I am managing different types of pages: the main root page (/) today's chapter page (/929 OR /929/) which eventually redirects to /929/<CHAPTER> where <CHAPTER> is a natural number between 1 to 929 individual chapter pages (/929/<CHAP ...

Using Polymer in Chrome Extension content script

Currently, I am experimenting with incorporating Polymer into a chrome extension. My main objective is to take advantage of styling encapsulation in order for my content scripts to operate independently from the CSS on the visited webpage. To begin, I hav ...

What is the best way to utilize bilinear color interpolation with JavaScript?

I'm grappling with the concept of bilinear interpolation, wondering if there's a more efficient method than what I've attempted below using the Culori library's interpolate() function. My uncertainty lies in whether it's correct t ...

"Sending an array in a POST request using Javascript and processing it on the server

I am trying to use ajax to send an array. Let's say the array looks like this: var anotherOne = 'anotherOneData'; var documents = ['banana', 'apple', 'monkey']; I successfully sent both a normal value and an a ...

Angular 2: Emptying input field value on click event

I am experiencing an issue with resetting my input values. I have a search bar with filter functions. When I enter a value, it displays a list below and I want to add a function to these links. When I click on one of them, it takes me to another component ...

What occurs when Click events are triggered on an <object> element?

I have set up a div, and inside that container, I embedded an SVG image using object (which I plan to manipulate later...). <div id="click-me"> some random Text <object data="some.svg" /> </div> Next, I added event listeners for t ...

Learn how to easily modify a value in a CVS file by simply clicking on the data point on a highcharts graph

Is there a way to update my CSV file by clicking on a graph? I want to be able to create a graph from data in the same CSV file and then, when I click on a point, set that point to zero on the y-axis and update the corresponding value in the CSV file to 0. ...

Can you demonstrate how to convert a string date array into a JavaScript array?

I am facing a challenge where I need to convert a string representation of an array into a JavaScript array for the purpose of looping. The string in question is enclosed within single quotes. Inside my JavaScript code, I have the following: var length1 ...