Hi When saving the Named Credentials record I get error=redirect_uri_mismatch&error_description=redirect_uri%20must%20match%20configuration
The URL is set as described in "The domain from the callback URL that shows in the authentication provider. For example, if the callback URL is https://www.example.com/services/authcallback/PermhelperAuth, then the domain is https://www.example.com."
Hi Allan,
After creating/updating the connected app, salesforce takes up to 10 minutes to reflect the change, after that time you can configure the named credentials.
Your error is for Mismatch URI which means Callback URL wasn't added in the connected app for which you are using Client ID and Secret, if added then you have to wait for few minutes.
- Make sure that Callback URL from Auth Provider is copied into connected app Callback URL.
- Make sure that connected app consumer key & Consumer Secret are copied into your Auth Provider consumer key & Consumer Secret fields
- 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.
Sorry - forgot the step where I was to update the callback URL in the Conneced App
I was facing this error from past few hours and was trying to find solution. it was very frustrating. finally i was able to fix this.
Under Connected App, OAuth i gave this permission.
Manage user data via Web browsers (web)
Full access (full)
Perform requests at any time (refresh_token, offline_access)
And Enabled : Enable Client Credentials Flow
Now in Postman i used below URLs
Auth URL - https://login.salesforce.com/services/oauth2/authorize
Access Token URL - https://xxxxxxxx-dev-ed.my.salesforce.com/services/oauth2/token
<<Replace with your custom URL>>
Code challenge Method - HSA
Client Auth - Send client credential in Body
Hope this will fix the error.
Stil after updating the call back URL, getting the same error
Callback URL | https://test--testbox.sandbox.my.salesforce.com/services/authcallback/ApexMDAPI
URL https://test--testbox.sandbox.my.salesforce.com/
When I save getting following error
error=redirect_uri_mismatch&error_description=redirect_uri%20must%20match%20configuration
Lightning
From Setup, enter App in the Quick Find box, then select App Manager.
Classic
Setup | Apps | Click on your connected App
Then Click on Edit and fill the value in Callback URL field.