I'm getting the following error message after authorization.
Salesforce identity does not match salesforce endpoint: you need to re-authenticate.
I've found that the issues lies in the getIdentity
method in /src/Rest/RestClient.php
on row 565. It seems that the salesforce.identity that's being fetched from the stage is serialized data, so when the code is trying to parse the URL it just returns NULL since its running the parse_url function on serialized data string. Everything works if I comment out the throw exception on line 574.
The identity variable's serialized data does contain the correct values as far as I can see.
I tried running unserialize on the identity variable, but it also returned NULL.
I'm running this on a local docker installation with a self signed SSL certificate, I don't know if that could be the reason for the error.
Does anyone have any idea what's going on?
Let me know if you need more information.
Comment | File | Size | Author |
---|---|---|---|
#8 | salesforce-endpoint_verification_option-3045542-8.patch | 3.73 KB | AaronBauman |
Comments
Comment #2
AaronBaumanUse test.salesforce.com or www.salesforce.com for your endpoints, instead of the CS-, NA-, or vanity subdomains.
Comment #3
AaronBaumanComment #4
Anonymous (not verified) CreditAttribution: Anonymous as a volunteer and commentedI'm having the same issue however it also states "Successfully connected to https://cs97.salesforce.com" as well as "Salesforce identity does not match salesforce endpoint: you need to re-authenticate. " I'm using the login URL for sandbox "https://test.salesforce.com"
I did not have this issue before updating to Version: 8.x-3.3
Comment #5
AaronBaumanThis has generated enough error reports that I think it's probably worth providing an opt-out for this feature
Patch will contain:
* Add a new config bool like endpoint_url_validation default to TRUE
* Wrap the url check in ::getIdentity() with a conditional
* Expose the setting on the settings form
* Add a hook_update_N to set TRUE on existing sites
Comment #6
Rapaidi CreditAttribution: Rapaidi commentedI'm also getting the same error
Salesforce identity does not match salesforce endpoint: you need to re-authenticate
when connecting to my companies sandbox or uat box, whose urls are like https://company--yoda.lightening.force.com
but I'm able to connect to login.salesforce.com with out any issues, it worked, so issue is only with these urls I think
When is the patch going to be released ?
Comment #7
dabonde CreditAttribution: dabonde commentedI've also ran into this issue in my developement environment connecting to https://test.salesforce.com. I'm guessing this might be because I don't run localhost behind ssl, which is fine from a salesforce perspective.
I've commented out the error throw as the OP has suggested in order to continue developement.
Comment #8
AaronBaumanThis patch adds a "endpoint_verification" setting, enabled by default for BC.
Can someone please try the patch, disable the new setting, and confirm that their issues are resolved?
Comment #9
ShaneStreator CreditAttribution: ShaneStreator commentedDrupal version: 8.7.3
Salesforce version: 8.x-3.3+3-dev
Administration > Salesforce > Salesforce Authorization:
- After I save configuration in 'API / OAUTH CONNECTION SETTINGS' I receive the following messages:
Success(green) Box:
{
- Callback URL: https://dev-schaumburg.pantheonsite.io/salesforce/oauth_callback
- Successfully connected to https://na132.salesforce.com
}
Warning(yellow) Box:
{
- Salesforce identity does not match salesforce endpoint: you need to re-authenticate.
}
Below are the 'Recent log messages' I receive when attempting to save configuration.
Dropbox (error screenshots): https://www.dropbox.com/sh/fcbks6v5js6kksc/AABOP6oHK2tAB-2vrvZRZocOa?dl=0
Comment #10
AaronBaumanYour endpoint should be https://login.salesforce.com, not https://na132.salesforce.com
Comment #11
ShaneStreator CreditAttribution: ShaneStreator commented@AaronBauman
That is what I currently have, I have also tried the "https://test.salesforce.com".
Below is a link with the configuration/errors after "Save configuration" is clicked.
https://www.dropbox.com/s/iv1c6fhsp986u1j/Salesforce%20Authenticate.png?...
Comment #12
AaronBaumanI see.
You should have some luck with the patch from #8 then
Comment #13
ShaneStreator CreditAttribution: ShaneStreator commented@AaronBauman
I should have mentioned I tried both patches on this thread and it "skipped" them.
Terminal message:
https://www.dropbox.com/s/z5odrgpwf29ajo1/Salesforce%20Patch.png?dl=0
Comment #14
armyguyinfl CreditAttribution: armyguyinfl as a volunteer and commentedAaron,
I am now able to run SF drush pull commands with Drush 9 and using BLT locally without error.
Thank you!
Comment #15
ShaneStreator CreditAttribution: ShaneStreator commentedIt seems "git apply" was not working properly for me.
I have not had time to confirm but applying the patch with another method may work when I have a minute to retry it.
Comment #16
armyguyinfl CreditAttribution: armyguyinfl as a volunteer and commentedThe patch is still being skipped for me as well, maybe path structures are diff? – @AaronBauman
Can you provide a working patch which can be applied via composer install?
I re-created the patch myself and the same thing is happening - skipped.
Additional Note
https://www.drupal.org/project/salesforce/issues/3063165
Comment #17
AaronBaumanI was able to apply the patch using composer by removing the module directory and composer.lock file, then re-installing
Comment #18
luengo.roberto@gmail.com CreditAttribution: luengo.roberto@gmail.com commentedHello team,
I created issue #3066530 which is very related to this one.
Before we move ahead and try to install the patch provided above, can somebody check and confirm it is still the best option? Is the changes from the patch in version 3.3 of the module?
Comment #20
AaronBaumanThe new config is committed.
This includes a database update, which should be applied before making any changes in UI or config.
Comment #21
oliversl CreditAttribution: oliversl commentedI still get
Salesforce identity does not match salesforce endpoint: you need to re-authenticate.
on Sandbox, using test.salesforce.comComment #23
nishantkumar155 CreditAttribution: nishantkumar155 commentedI have used patch #8. but still same issue
Comment #24
nishantkumar155 CreditAttribution: nishantkumar155 commented