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
MiddhaMiddha 

Authenticate Salesforce User with IDP Credentials (using SAML)

Hi , 

We have a third party IDP setup with Salesforce as SP and are using IDP initiated flow to authenticate the user which works well from browser. We need the Salesforce session Id using IDP credentials via code. Is there any way we can do that?

Though we can generate a SMAL assertion and post it to Salesforce directly but we need to sign that assertion with IDP key which IDP does not shares. Any other options?
Ashish_SFDCAshish_SFDC
Hi , 


UserInfo.getSessionId() : Returns the session ID for the current session.


HOW TO GET SALESFORCE SESSION ID

String MySessionID = UserInfo.getSessionID();

http://rainforce.walkme.com/how-to-get-salesforce-session-id/#.U4iHG_mSwpE


Regards,
Ashish