How to login to salesforce using session id?

| By Webner

We may also access Salesforce without having to enter a username and password. We may log into Salesforce using the session ID.

To log in to salesforce using session-id follow the following steps:

Step 1: execute this piece of code in the “Anonymous window” of the developer console

String sessionID=UserInfo.getOrganizationId()+''+UserInfo.getSessionId().subString(15);
system.debug('session id '+sessionID);

After this, you will get the sessionId now copy the sessionId
Step 2: in the below URL paste the copied sessionId instead of
https://<endpoint host>/secur/frontdoor.jsp?sid=<session id>”

Step 3:- in below URL paste the login URL instead of <endpoint host>
https://<endpoint host>/secur/frontdoor.jsp?sid=<session id>”

Copy the highlighted link and paste it instead of “<endpoint host>”


Now using this URL you can log in to sales force in any other system without using a username and password

Leave a Reply

Your email address will not be published. Required fields are marked *