pgonzaleznetwork / HappySoup.io

The best way to visualize your salesforce dependencies
MIT License
198 stars 36 forks source link

Fail to connect to my Salesforce org without IP #214

Open itaishmida opened 1 year ago

itaishmida commented 1 year ago

I am trying to login to https://www.happysoup.io/ I always get this error: We were unable to log into your salesforce org. Try clearing the cache and cookies, using another browser or another org. I am trying to connect to many different sandboxes of mine - all give same results I have seen on my user that the IP address is blocked: 44.195.38.159 I have added this IP now all is good ;o) maybe this needed to be added to the docs

itaishmida commented 1 year ago

After login in I tried to get some metadata (any metadata gave the same results) and I got this error: `We are sorry, something went wrong. Please click here to log a Github issue so that we can review the error. Please include the following details: INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session

Error: INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session at Object.listMetadata (/app/node_modules/sfdc-happy-api/lib/metadata.js:27:19) at processTicksAndRejections (internal/process/task_queues.js:95:5) at async Object.listMetadataJob (/app/backend/db/queue/jobs.js:55:26) at async Queue. (/app/backend/db/queue/worker.js:25:20)`

So in session setting: /lightning/setup/SecuritySession/home I have removed setting: Enforce login IP ranges on every request and: Lock sessions to the IP address from which they originated Now all works ok

pgonzaleznetwork commented 1 year ago

Thank you @itaishmida !

This is indeed because of the configuration of IP restrictions in your org, so the behavior was expected.

Of course, I could have returned a better error message for this, so I'll do that in the future.

Failed SOAP response while calling listMetadata() on metadata API {"fetchOptions":{"method":"POST","headers":{"Content-Type":"text/xml;charset=UTF-8","SOAPAction":"c","Accept-Encoding":"gzip,deflate"},"body":"<soapenv:Envelope xmlns:soapenv=\"[http://schemas.xmlsoap.org/soap/envelope/\](http://schemas.xmlsoap.org/soap/envelope/%5C)" xmlns:met=\"[http://soap.sforce.com/2006/04/metadata\](http://soap.sforce.com/2006/04/metadata%5C)">\n <soapenv:Header>\n <met:SessionHeader>\n <met:sessionId>00D8M0000004ekt!AQMAQN0Ofzlvo8ScZJM5G.CvvM0NcMxlsR9uSy2tie.4tXYa4WIJ2mxXHE.kW2TmFtgMpZhIsIKuyKQdkFyxDW437.zkEKcG</met:sessionId>\n </met:SessionHeader>\n </soapenv:Header>\n <soapenv:Body>\n <met:listMetadata>\n <met:queries>\n <met:type>CustomField</met:type>\n </met:queries>\n <met:asOfVersion>48.0</met:asOfVersion>\n </met:listMetadata>\n </soapenv:Body>\n </soapenv:Envelope>"},"json":{"soapenv:Envelope":{"soapenv:Body":{"soapenv:Fault":{"faultcode":"sf:INSUFFICIENT_ACCESS","faultstring":"INSUFFICIENT_ACCESS: Access from current IP address is not allowed"}}}}

itaishmida commented 1 year ago

Thanks @pgonzaleznetwork Maybe just a few words on the docs would be enough