question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to login into salesforce 23 using session id

See original GitHub issue

Current behavior

Until the salesforce 23 release which released around a month back, cypress was able to login into salesforce through soap request. However after salesforce 23 release, cypress is unable to log into salesforce which i believe is global issue as others too are facing it.

Below are the steps :

  1. soap request payload as
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:partner.soap.sforce.com">  
     <soapenv:Body>  
        <urn:login>  
            <urn:username>username@example.com</urn:username>  
            <urn:password><<password>><<session_id>></urn:password>  
         </urn:login>  
     </soapenv:Body>  
</soapenv:Envelope> 
  1. Then passing above payload as request to log into SF as below,
Cypress.Commands.add("loginAsTestUser", () => {
  cy.readFile("soapRequestBodyTestUser.xml").then(
    (requestBody) => {
      cy.request({
        method: "POST",
        url: "https://test.salesforce.com/services/Soap/u/35.0",
        headers: {
          SOAPAction: "abc",
          ["Content-Type"]: "text/xml"
        },
        body: requestBody
      }).then((response) => {
        const sessionID = Cypress.$(response.body).find("sessionId").text();
        cy.visit("https://xxx--qa.sandbox.lightning.force.com/secur/frontdoor.jsp?sid="+sessionID);
      });
     }
  );
});
  1. After calling above command in cypress runner, cypress is unable to move ahead of salesforce 23 logo cy_1

  2. Also we could see below exception in cypress logs which was not there before salesforce 23 release, image

Desired behavior

No response

Test code to reproduce

SOAP request payload as

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:partner.soap.sforce.com">  
   <soapenv:Body>  
  <urn:login>  
      <urn:username><<salesforce_username>></urn:username>  
      <urn:password><<password>><<session_id>></urn:password>  
      </urn:login>  
   </soapenv:Body>  
</soapenv:Envelope>  

Then passing above payload as request to log into SF as below,

Cypress.Commands.add("loginAsTestUser", () => {
  cy.readFile("soapRequestBodyTestUser.xml").then(
    (requestBody) => {
      cy.request({
        method: "POST",
        url: "https://test.salesforce.com/services/Soap/u/35.0",
        headers: {
          SOAPAction: "abc",
          ["Content-Type"]: "text/xml"
        },
        body: requestBody
      }).then((response) => {
        const sessionID = Cypress.$(response.body).find("sessionId").text();
        cy.visit("https://xxx--qa.sandbox.lightning.force.com/secur/frontdoor.jsp?sid="+sessionID);
      });
     }
  );
});
  1. After calling above command in cypress runner, cypress is unable to move ahead of salesforce 23 logo cy_1

  2. Also we could see below exception in cypress logs which was not there before salesforce 23 release, image

Cypress Version

10.8.0

Node version

v14.20.0

Operating System

Windows 10 Enterprise

Debug Logs

No response

Other

No response

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:1
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

6reactions
astone123commented, Sep 30, 2022

@Rogeriohsjr thanks so much for the test project! I was able to reproduce the issue with that. Going to route this to one of our internal teams to take a look at

4reactions
poponutscommented, Oct 17, 2022

This is a blocker for most Salesforce tests. Once Salesforce roll out the latest Winter 23 across all environments then everyone using Cypress for Salesforce tests will be failing. Can the Cypress team prioritise this? Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to log in to Salesforce
1. User can't log in with the correct username and password · Make sure your user is trying to log in from the...
Read more >
Unable to login using Frontdoor.jsp - Salesforce Stack Exchange
Using the frontdoor.jsp to get a session id is not a supported way of logging in, it might work, but salesforce can change...
Read more >
Login to Lightning enabled Salesforce instance using SessionId
on above URL, you have to replace [instance] by actual salesforce instance name and [sessionId] by actual sessionId of user.
Read more >
How to Troubleshoot Error 'Failed to Send Request' or Unable ...
Users who attempt to connect to Salesforce via Data Loader login may receive an error, Failed to send request.
Read more >
Salesforce connector exception is not caught by Mule ...
Possible solutions: 1. Increase the Session timeout in Salesforce (if this is the case)! 2. Use the "Disable session invalidation" field from the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found