Reply
Member
Posts: 4
Registered: ‎01-14-2021
Accepted Solution

The requested redirectUri does not match error trying to retrieve access token

I'm trying to retrieve the access token after going through the redirect process mentioned here https://developer.authorize.net/api/reference/features/oauth.html 

 

Code and client_id have been changed to protect the innocent.

 

 

HttpRequest req = new HttpRequest();
req.setEndpoint(https://accesstest.authorize.net/oauth/v1/token?code=XXXX&grant_type=authorization_code&client_id=XXXXXX&platform=2">);
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);

 

 

The response I get back in the body is 

{"error":"invalid_request","error_description":"The requested redirectUri does not match"}

If I change the 'code' value I get

{"error":"invalid_request","error_description":"Invalid authorization code"}

which makes sense so it seems like it's accessing the accounts correctly.

 

Does anyone have an idea of what's going on?

 

Thanks

 

 

 


Accepted Solutions
Solution
Accepted by topic author MikeBreadwinner
‎01-25-2021 07:16 AM
Member
Posts: 4
Registered: ‎01-14-2021

Re: The requested redirectUri does not match error trying to retrieve access token

I ended up recreating a new Client Id & Client Secret via  'Add Application' in Partner Integration.  I guess the old one got messed up somehow

View solution in original post


All Replies
Solution
Accepted by topic author MikeBreadwinner
‎01-25-2021 07:16 AM
Member
Posts: 4
Registered: ‎01-14-2021

Re: The requested redirectUri does not match error trying to retrieve access token

I ended up recreating a new Client Id & Client Secret via  'Add Application' in Partner Integration.  I guess the old one got messed up somehow