The authorisation callback uses an & instead of a ? so it's not possible to authorise.

Here are the callback urls being generated:

https://test.salesforce.com/services/oauth2/authorize?redirect_uri=https...&response_type=code&client_id=...

And the resulting error:
error=redirect_uri_mismatch&error_description=redirect_uri%20must%20match%20configuration

When the url should have been:

https://test.salesforce.com/services/oauth2/authorize?redirect_uri=https...?response_type=code&client_id=...

The work around is to the the call back url on salesforce to:
https://example.org/?q=salesforce/oauth_callback

And apply the following patch to include/salesforce.in:

358c358
<     return url('', array(
---
>     return url('salesforce/oauth_callback', array(
361d360
<       'query' => array('q' => 'salesforce/oauth_callback')

This was tested on Drupal 7.26

Very similar to https://drupal.org/node/2127251

CommentFileSizeAuthor
#1 url-mismatch-fix-2276921-1.patch5.62 KBjakubmroz

Comments

jakubmroz’s picture

StatusFileSize
new5.62 KB

Hi guys,

I'm currently working on a big salesforce integration project and found that issue.
In the meantime, I created a patch which worked for us and we were able to authenticate the service with Salesforce.

Please check it and if you have any questions, shoot.

jakubmroz’s picture

Status: Active » Needs review
aaronbauman’s picture

Version: 7.x-3.0 » 7.x-3.x-dev
Status: Needs review » Needs work

First:
This unrolls a bunch of changes that were recently pushed.
Please re-roll against latest dev.

Next:
Are you not using clean URLs?
Why do you need the "?q=" in your oauth callback?

aaronbauman’s picture

Status: Needs work » Closed (won't fix)

7.x is no longer supported

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.