Why getting the error=redirect_uri_mismatch in Salesforce Mobile SDK?

812    Asked by AmitSinha in Salesforce , Asked on Apr 24, 2021

 I created a hybrid_local mobile app with forcedroid and worked fine with my dev org. But when I tried to run the same app with one of our company sandboxes, it's giving the below error on the emulator even without going to the Salesforce login page for the OAuth process, error=redirect_uri_mismatch&error_description=redirect_uri must match configuration Since I'm still playing around with the SDK I believe this is because some configuration still needs to be done(error description also says btw). If anybody knows about this or a common mistake, please be kind enough to help me out. To call the sandbox I've configured the following things so far. Altered the remoteAccessConsumerKey at assetswwwbootconfig.json in the app Altered the remoteAccessConsumerKey at resvaluesbootconfig.xml in the sdk library And for both organizations, the call-back URL is the same. When I connect to dev org it's working fine. Only the difference is the consumer key. What/ Where do I need to do the missing configuration?

Answered by Andrew Jenkins

This error message indicates that the integration was unable to recognize the Callback URL in your Salesforce-connected app settings. ... You are using the verbiage of “yoursubdomain” as part of the URLs instead of the actual subdomain name. In the connected app at the Salesforce side, the Callback URL was different with the oauthRedirectURI value in the bootconfig.josn. It was having the default value for the oauthRedirectURI and after replacing it with the salesforce connected app's Callback URL it's working fine. But it's confusing how it was working with the default value when I connect to my dev org.



Your Answer

Interviews

Parent Categories