13

I am connecting two salesforce orgs with connected app, named credential and Auth Provider.

  1. I have created connected app in target sandbox.
  2. Created Auth Provider in source org by providing Consumer and secret key from above connected App.
  3. Updated connected app callback URL with the call back url from Auth provider.
  4. Created named credential from above Auth provider.

When trying to authorise I am getting following error "error=redirect_uri_mismatch&error_description=redirect_uri%20must%20match%20configuration". Can some one help me understand what I am doing wrong.

1
  • What token and auth URL are you providing in the Auth Provider? Can you also grab the query parameter that contains the redirect_uri and see if it is the same as what you provided? Commented May 26, 2018 at 5:55

5 Answers 5

11

I had the same problem. I found that callback url in the connected app should be the same as you have in your redirect_uri. I tested it with a tool called postman, maybe that can help you as well.

1
  • 1
    @user2945545 I looked for this too, but eventually found it: if you click the Auth Provider record, you'll find the Redirect URI there :) Commented Mar 6, 2021 at 0:30
1

I encountered this problem and found a solution for me which could work for you all as well.

This problem was of Mismatch URL's you are providing in Auth. Provider and In Named Credentials.

Your Authorize Endpoint URL & Token Endpoint URL Must Have The Same Instance URL With The URL You're Providing In Named Credentials.

For Example:

enter image description here

enter image description here

If You Found My Answer Helpful Then Please Upvote And Follow Me For Regular Updates On LinkedIn: https://www.linkedin.com/in/surjeet-singh-841116198/

0

Check callback URL in salesforce and callback URL in postman are same.

  1. In my case callback url field some time not editable in postman so I copied callback url from postman and changed in salesforce, This work fine me,else un check check twice this section copy paste that link to salesforce callback This procedure work for me.
0

In Named Credential, update the url with Current My Domain URL including http or https. It should not be like "........lightning.force.com".

0
  1. Make sure that Callback URL from Auth Provider is copied into connected app Callback URL.
  2. Make sure that connected app consumer key & Consumer Secret are copied into your Auth Provider consumer key & Consumer Secret fields
  3. In the Named Credential Url put Current My Domain URL Note:which can be found under setup=> My Domain (directly search My Domain in quick find ) => Current My Domain URL ( just prefix this url with https:// and add this in Named Credential Url field ). click save.

you will be redirected to login page. where you have to provide username ,password of user (generally integration/api user).

Basically that means whenever you perform API Callout using this Named credential then record will be modified/created by this user.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .