+ Start a Discussion
ayu sharma devayu sharma dev 

Get session Id without using token and Connected app.

I am new to salesforce rest and soap api, I am trying to get the session Id from Salesfroce so I can use it for other restservices. I am able to do this using the Soap api but it requires token along with username ana password.
Is there any way I can get session Id only using username and password.
I don't want to create a connected app as my app is for every org, so i get to create it on all the orgs, which certainly I dont want.
Please suggest a Solution.
Raj VakatiRaj Vakati
You can get the session id using UserInfo.getSession() 

Refer below link: -


Also, Use UserInfo.getSessionId() method to get the Login User Session Id.

You can use Password Authentication


 how to get session id without using username and password and security token.
Use UserInfo.getSessionId() method to get the Login User Session-Id.


ayu sharma devayu sharma dev
Hello Raj, thanks for the quick response.
The problem is I am not using the login using the Apex I am building a third party app, So userinfo.getSessionId() won't work for me.
I want get the session Id just like how Dataloader and Visual Studion Code does. Is there any chance I can login like that too.