+ Start a Discussion
Krishna Prasad K PKrishna Prasad K P 

Opening SFDC page from Session Id and record ID



We have an integration where in we have the SFDC record GUID stored in that application and also we have the fresh SFDC session id as well in that application. We need to provide the UI functionality by which,  by clicking a link on that Application, a browser should be opened showing the detail page of the particular record . So please help in framing the URL to the SFDC detail page from the below info:



  1. SFDC Session Id
  2. SFDC Record GUID
> Do I need server URL as well? If yes, can I use generic URLs like "login.salesforce"  for Production and "test.salesforce" for sandbox? (means, without instance prefixes like na5, cs0, tapp0.)



List out of any other info I must have for this. 


Thanks for your help





There are a couple of things about this that need consideration:


1. Session IDs are user specific, meaning that if you have a fresh Session ID, then any person who clicked the link would be logged in aas the same user, regardless if they had their own username.  There is concern about this as it could be a licensing issue (every individual accessing salesforce.com should have their own username)


2. The login.salesforce.com page only takes a username and password, so if you did this you would have to code directly to the specific instance


3. Session IDs can be specific to the mode in which they were generated.  For instance, a Session pulled from Visualforce will not allow you to make API calls or to log into the UI


That said, you can get in by usingL




This would log me into nax and bring me to the account with the id of /001xxxxxxxxxxx, assuming the user who generated the session had access to the record.


The proper way to do this would be to implement an SSO solution which would validate the user on your side clicking the link, generate the new session information, and then redirect to the page desired.  This way, each user would be using their unique username to access data in salesforce.com.


You can find out about the SSO options in the Help and Training - https://na1.salesforce.com/help/doc/en/salesforce_single_sign_on.pdf


Hope this helps.



Krishna Prasad K PKrishna Prasad K P

Thanks Jay for the input.


Licencing issue:  Each user who clicks the link from the Application have individual login account in SFDC.


The session to SFDC is established by SSO in that App. The app stores the sessionId. So for opening the page in UI, going through SSO may create parallel session again, so thought of reusing the sessionId in the app for opening the SFDC page.


Please share your comment on it.







Creating a parallel session would not really matter, since the old session would just expire after it was not used (default 2 hours).  If you would like to reuse the session, though you can definitely do that.  Just use the link above to direct the user.