function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
OTOT 

single sign-on for internal application

Hi,
We want to have a link from salesforce.com to our custom web application but don't want to force the user to login again. I read somewhere that if you pass the userId, serverURL and sessionId then you can use the getUserInfo to verify that the user is indeed logged into salesforce.com. Is there any sample code in VB.Net on how to accomplish this? I'm new to this and do not know where to start.

Thanks!
DevAngelDevAngel
Hi OT,

It's actually pretty simple. Most of the samples show using the login call. The 2 most important pieces of data returned from the login call are the sessionid and the serverUrl. After a successful login you run the following code:

binding.SessionHeaderValue = new Sforce.SessionHeaderValue()
binding.SessionHeaderValue.sessionId = loginResult.sessionId
binding.url = loginResult.serverUrl

If you instead get the session id and server url from query params on a url, you would skip, the login call and just run the 3 lines above and instead of using the loginResult values, use the values that you parsed out of the query params.

Clear?