title: Actions on Google and Account linking failure after tokens returned
body: <p>Trying to test auth in the Web Simulator using the OAuth2 Authorization Code Flow, <a href="https://developers.google.com/actions/tools/web-simulator" rel="nofollow noreferrer">https://developers.google.com/actions/tools/web-simulator</a></p>
  
  <p>See: <a href="https://developers.google.com/actions/tools/testing#testing_account_linking_with_google_home_web_simulator" rel="nofollow noreferrer">https://developers.google.com/actions/tools/testing#testing_account_linking_with_google_home_web_simulator</a></p>
  
  <p>And:
  <a href="https://developers.google.com/actions/develop/identity/oauth2-code-flow" rel="nofollow noreferrer">https://developers.google.com/actions/develop/identity/oauth2-code-flow</a></p>
  
  <p>Provided you've setup your Action to require authorization against your authorization service, when you try to access your Action the Assistant advises you that you need to Link your account.
  In the same response the simulator provides a URL for initiating the linking process, see:</p>
  
  <pre><code>"debugInfo": {
      "sharedDebugInfo": [
          {
              "name": "Account Linking Url",
              "debugInfo": "https://assistant.google.com/services/auth/handoffs/auth/start?provider=your-google-project-id_dev&amp;scopes=your-scopes&amp;return_url=https://www.google.com/"
          }
      ]
  }
  </code></pre>
  
  <p>Calling this URL (paste into a browser) will take you through an OAuth2 flow, assuming the user actions required are successful Google will call your token endpoint with the authorization code provided during the flow.</p>
  
  <p>But then I was getting:</p>
  
  <pre><code>result_code=FAILURE&amp;result_message=Account+linking+failed
  </code></pre>
  
  <p>It all appeared to be working from my side but Google was returning a FAILURE.</p>