Loading

Use of frontdoor.jsp to Log in to Salesforce

Publiceringsdatum: May 6, 2026
Beskrivning

The frontdoor.jsp endpoint allows developers to authenticate Salesforce users from a custom web interface — such as a remote access Force.com site, third-party portal, or external API integration — using an existing session ID and server URL. This is useful for Single Sign-On (SSO) scenarios where users need to be redirected into Salesforce without re-entering credentials. Note: not all session types are supported. Visualforce sessions generated by {!GETSESSIONID()} cannot be used, and for Experience Cloud (Community) site API sessions, SAML SSO is the recommended alternative due to security constraints. A more secure version using a single-use access token is also available and is recommended for new implementations.

Lösning


Use frontdoor.jsp to give users access to Salesforce from a custom web interface, such as a remote access Force.com site or other API integration, using their existing session ID and the server URL. For Experience Cloud sites, use a web-scoped access token. Here's an example of what the URL would look like:

https://instance.salesforce.com/secur/frontdoor.jsp?sid=session_ID&retURL=optional_relative_url_to_open

Replace session_ID with a valid Salesforce access token or session ID and instance with your Salesforce instance hostname. The retURL parameter is optional and specifies the Salesforce page to open after login.



Retrieve the session ID 

Session ID Sources:

  1. The access_token from an OAuth authentication. Note that one of the scopes specified when you create a connected app must be web or full.
  2. The LoginResult returned from a SOAP API login() call.
  3. The Apex UserInfo.getSessionId().

The session ID returned using the Visualforce {!GETSESSIONID()} cannot be used on frontdoor.jsp.
Not all session types are supported with frontdoor.jsp, such as Experience Cloud site API sessions (security risk). For these sessions, consider using SAML for Single Sign-On instead.

New Frontdoor Single Access (Recommended for New Implementations)
We also have a new version of login using access token with frontdoor.jsp without the exposing the access token. More details can be found here.
Knowledge-artikelnummer

000386254

 
Laddar
Salesforce Help | Article