title: What is the redirect_uri in Alexa Skill Activation API?
body: <p><strong>Background</strong></p>
  
  <p>I'm implementing Alexa's <a href="https://developer.amazon.com/en-US/docs/alexa/account-linking/app-to-app-account-linking.html" rel="nofollow noreferrer">App-to-App Account Linking</a> Flow, and I'm stuck on Step 6 - enabling the skill using Alexa's <a href="https://developer.amazon.com/en-US/docs/alexa/account-linking/skill-activation-api.html" rel="nofollow noreferrer">Skill Activation API</a>.</p>
  
  <p>Concretely, I am not sure what value to supply to the <code>redirect_uri</code> POST field. In the docs, the following description is provided:</p>
  
  <blockquote>
    <p>The redirect_uri parameter that was included in the authorization request to your OAuth 2.0 server to obtain the user's authorization code. This enables Amazon to retrieve access tokens from your token server. This URL must be opaque to Amazon.   </p>
  </blockquote>
  
  <p>My understanding is that Alexa wants to exchange an existing authorization code for an access token, but I don't know how Alexa is trying to accomplish this "under the hood" and my current approach throws a 400 error.</p>
  
  <p><strong>Error Message</strong></p>
  
  <pre><code>[status]  400
  [response]  {"message":"Could not contact provider of account linking credentials"}
  </code></pre>
  
  <p><strong>Notes</strong></p>
  
  <ul>
  <li>My app uses Firebase authentication, and creates accounts for users via federated login with Google and Facebook. Thus, Google and Facebook redirect back to my native app (React Native).</li>
  <li>I do not have a universal link; instead in my account-linking flow,
  the Alexa app redirects users to an html page that redirects to my app using its custom schema.</li>
  <li>When a user signs into my app from Alexa, Alexa redirects them from my login page back to the Alexa app. In this case, the <em>Alexa</em> universal link is the redirect url.</li>
  <li>When a user signs into Alexa from my app (app-to-app linking), The Alexa app redirects them to my app. My app is the redirect url.</li>
  </ul>
  
  <p>I have tried using my app's [faux] "universal link" as the redirect url, to no avail. There are no other redirects in my login flows. What is this url supposed to be? </p>
  
  <blockquote>
    <p>NB: I have a endpoint for exchanging an auth_code for an access_token. The token is returned in the body; there's no redirect with the access_token appended to the redirect_url.</p>
  </blockquote>
  
  <p><strong>Example Skill Activation</strong> (my React Native app):</p>
  
  <pre><code>async enableSkill() {
      try {
          let response = await fetch(`https://api.amazonalexa.com/v1/users/~current/skills/${this.skillId}/enablement`, {
              method: 'POST',
              headers: {
                  'Authorization': `Bearer ${this.alexaAccessToken}`,
                  'Content-Type': 'application/json'
              },
              body: JSON.stringify({
                  stage: 'development', // or live
                  accountLinkRequest: {
                      redirectUri: Linking.makeUrl(), // &lt;--- unsure
                      authCode: this.myAppAuthCode, // &lt;-- auth code from my system, not Alexa's
                      type: "AUTH_CODE"
                  }
              })
          });
  
          return response.json();
      } catch (err) {
          throw new Error(err);
      }
  }
  </code></pre>