cancel
Showing results for 
Search instead for 
Did you mean: 

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

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

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

1 REPLY 1

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