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
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | url-mismatch-fix-2276921-1.patch | 5.62 KB | jakubmroz |
Comments
Comment #1
jakubmroz commentedHi 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.
Comment #2
jakubmroz commentedComment #3
aaronbaumanFirst:
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?
Comment #4
aaronbauman7.x is no longer supported