Skip to content

Unable to login into salesforce 23 using session id #23958

Closed
@jpatil14

Description

@jpatil14

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions