function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
dev401hasdev401has 

error=redirect_uri_mismatch

Hi

 

I was checking out the application Contact Viewer.

I took the code from https://github.com/ForceDotComLabs/Contact-Viewer

And also performed all the steps mentioned there.

 

Now once i go back and hit the URL of my site, then instead of the application I get the following error:

error=redirect_uri_mismatch&error_description=redirect_uri%20must%20match%20configuration

 

I check out few things. The redirecturi is coming null in the URL and hence this error is coming. 

redirectUri is equivalent to the callback URL provided in the Remote access detail and i have provided the same (Call back URL = my force.com site's address).

 

Can anyone guide me as to how to solve this error?

cloudcodercloudcoder

The redirect URI you provide in your code must match (exactly) this one you set in your remote access settings. Can you post a snippet from where you are setting your redirect URI in your code?

akhilesh_sfdcakhilesh_sfdc

For contact viewer, make sure you have set the custom setting "Contacts App Settings" property "OAuth Client Redirect URI" as the Callback URL from Remote Access settings. This is detailed on the installations steps point 3(3).

 

-Akhilesh

mdjekicmdjekic

Hi,

 

I have the same issue when trying to develop authentication with SalesForce. I've checked and rechecked and I am deffinetly sending the correct URL but keep getting the same error: redirect_uri_mismatch. RemoteAccessAppissetupcorrectly.

 

Can anyone help me in understanding this error?

akhilesh_sfdcakhilesh_sfdc

If you created/modified a Connected app policy in salesforce, it may take upto an hour sometimes to propagate to all our instances. Let me know if you keep getting this error.

mdjekicmdjekic

Hi,

 

First of all, thank you for your reply.

 

I was searching a bit and found some examples where I noticed that the param is sent as "redirect_uri" with the "i" in the end, and the original documentation describes the param as "redirect_url" with an "l" in the end. When I changed this to "redirect_uri" it worked like a charm.

 

Here's the docs with the typo:

http://www.salesforce.com/us/developer/docs/api_rest/Content/intro_understanding_web_server_oauth_flow.htm

 

It says:

redirect_urlThe Callback URL from the remote access application definition.

 

Here's the example I was viewing:

http://developer.force.com/cookbook/recipe/interact-with-the-forcecom-rest-api-from-php

 

Thanks again for your reply.