<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic The requested redirectUri does not match error trying to retrieve access token in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/The-requested-redirectUri-does-not-match-error-trying-to/m-p/74758#M46516</link>
    <description>&lt;P&gt;I'm trying to retrieve the access token after going through the redirect process mentioned here&amp;nbsp;&lt;A href="https://developer.authorize.net/api/reference/features/oauth.html&amp;nbsp;" target="_blank"&gt;https://developer.authorize.net/api/reference/features/oauth.html&amp;nbsp;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code and client_id have been changed to protect the innocent.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;HttpRequest req = new HttpRequest();
req.setEndpoint(https://accesstest.authorize.net/oauth/v1/token?code=XXXX&amp;amp;grant_type=authorization_code&amp;amp;client_id=XXXXXX&amp;amp;platform=2"&amp;gt;);
req.setMethod('POST');
req.setHeader('Content-Type', 'application/x-www-form-urlencoded');
req.setHeader('v-c-client-correlation-id', 'unique id');

HttpResponse res = new HttpResponse();
res = new HTTP().send(req);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The response I get back in the body is&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;{"error":"invalid_request","error_description":"The requested redirectUri does not match"}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If I change the 'code' value I get&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;{"error":"invalid_request","error_description":"Invalid authorization code"}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;which makes sense so it seems like it's accessing the accounts correctly.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Does anyone have an idea of what's going on?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 21 Jan 2021 18:46:26 GMT</pubDate>
    <dc:creator>MikeBreadwinner</dc:creator>
    <dc:date>2021-01-21T18:46:26Z</dc:date>
    <item>
      <title>The requested redirectUri does not match error trying to retrieve access token</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/The-requested-redirectUri-does-not-match-error-trying-to/m-p/74758#M46516</link>
      <description>&lt;P&gt;I'm trying to retrieve the access token after going through the redirect process mentioned here&amp;nbsp;&lt;A href="https://developer.authorize.net/api/reference/features/oauth.html&amp;nbsp;" target="_blank"&gt;https://developer.authorize.net/api/reference/features/oauth.html&amp;nbsp;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code and client_id have been changed to protect the innocent.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;HttpRequest req = new HttpRequest();
req.setEndpoint(https://accesstest.authorize.net/oauth/v1/token?code=XXXX&amp;amp;grant_type=authorization_code&amp;amp;client_id=XXXXXX&amp;amp;platform=2"&amp;gt;);
req.setMethod('POST');
req.setHeader('Content-Type', 'application/x-www-form-urlencoded');
req.setHeader('v-c-client-correlation-id', 'unique id');

HttpResponse res = new HttpResponse();
res = new HTTP().send(req);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The response I get back in the body is&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;{"error":"invalid_request","error_description":"The requested redirectUri does not match"}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If I change the 'code' value I get&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;{"error":"invalid_request","error_description":"Invalid authorization code"}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;which makes sense so it seems like it's accessing the accounts correctly.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Does anyone have an idea of what's going on?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2021 18:46:26 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/The-requested-redirectUri-does-not-match-error-trying-to/m-p/74758#M46516</guid>
      <dc:creator>MikeBreadwinner</dc:creator>
      <dc:date>2021-01-21T18:46:26Z</dc:date>
    </item>
    <item>
      <title>Re: The requested redirectUri does not match error trying to retrieve access token</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/The-requested-redirectUri-does-not-match-error-trying-to/m-p/74804#M46553</link>
      <description>&lt;P&gt;I ended up recreating a new Client Id &amp;amp; Client Secret via&amp;nbsp; 'Add Application' in Partner Integration.&amp;nbsp; I guess the old one got messed up somehow&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 15:15:45 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/The-requested-redirectUri-does-not-match-error-trying-to/m-p/74804#M46553</guid>
      <dc:creator>MikeBreadwinner</dc:creator>
      <dc:date>2021-01-25T15:15:45Z</dc:date>
    </item>
  </channel>
</rss>

