Solved Salesforce Authorize Token fails with redirect_uri_mismatch

Status
Not open for further replies.

mrmmd

Customer
Joined
Mar 2, 2021
Messages
23
Reaction score
5
We are on V18 with server onsite. Using Salesforce V2 template. Followed all documentation and settings per the online article to set this up. My 'Refresh Token:" is blank so when testing it get this error:

Server returned a non successful status code - HTTPStatusCode=BadRequest - Reason=Bad Request - Content={"error":"invalid_grant","error_description":"expired access/refresh token"}

When clicking to 'Aurhorize' my token I receive this:

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


I've added all permission in the Salesforce OAuth scopes but the documentation permissions shown do not match current salesforce permission options. I've checked my token refresh policy and it is set to 'Refresh Token Until Revoked' so I know it's not a token issue.

Seems to be a URL issue. I've tested the URL and am able to reach our management console using the URL I entered in Salesforce and per the documentation from 3cx. I added the ':5001/api/oauth2crm' portion to the end of my URL as shown in the documentation.

My Consumer Key and Consumer Secret are entered and being passed to Salesforce.

Lastly I've followed all the forum posts to no avail and still not able to make this work. Should not be this difficult!
 
Please note that if you access your 3CX console without the ":5001" port number, then you must NOT add the port number in the URL you configure in Salesforce. The URL must be exactly the one you use in the 3CX Console, adding "/api/oauth2crm".

Also, please note that once you make any change, Salesforce takes up to 10 minutes to propagate this to all servers, so you will need to wait a bit to do this authorization.
 
To access it from outside of our network I DO have to use the :5001. I've tested and verified that and only able to access with the :5001.

Yes aware of the 10 min. delay.
 
You need to configure in Salesforce the URL you're using while you run the authorization in your browser. Salesforce will not access this URL from their servers. Your browser will be redirected to it.
 
Exactly that should work but isn't working. Same error:

error=redirect_uri_mismatch&error_description=redirect_uri%20must%20match%20configuration
 
Exactly that should work but isn't working. Same error:

error=redirect_uri_mismatch&error_description=redirect_uri%20must%20match%20configuration
That's weird, can you share a screenshot of the URL you use to access the console and the configuration you have in Salesforce?
 
Here is my url for accessing my admin console. Below are setup screens.


Screenshot.jpgSalesforce Setup1.jpgSaleforce OAuth Policies.jpg
 
Now receiving this error:

error=invalid_client_id&error_description=client%20identifier%20invalid
 
Okay finally. got it working YEAH!
 
  • Like
Reactions: edossantos
Status
Not open for further replies.

Forum statistics

Threads
112,147
Messages
590,960
Members
165,167
Latest member
Finatra.us