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
Amar SinghAmar Singh 

Unable to use Frontdoor.jsp to Log Into Salesforce


I am using Frontdoor.jsp to Log Into Salesforce from one of the the Salesforce Organization(Source) to another Salesforce Organization (Target).

I have created one Connected App in Target Org with web scope.

Connected App

As per the documentation, we can use access_token from an OAuth authentication instead of Session ID.

I am unable to redirect to Target Organization with access_token from an OAuth instead of session ID.


Daniel BallingerDaniel Ballinger
Have you also updated the subdomain in the targetUrl to match that used by the Org where the access_token/session_Id is valid?


Does the complete target URL with the correct domain and sid work if you use it outside of the connected app?

Are you getting any specific error messages?
Amar SinghAmar Singh
Thanks Daniel !!

1. I have added the domain in the targetURL to match the Target Org.


Domain settings

2. Yes, the complete target URL with the correct domain and sid works if I use Session ID (fetched from Developer Console -       
    UserInfo.getSessionId(); ) instead of access_token

3. I am not getting any specific error message,the redirected Page is asking for Username and Password instead of logging me in and even though    I provide the correct credentials its asking for the credentials again.
Marek SaktorMarek Saktor
I have the same issue, found another bunch of people with same issue, someone lists solution with SOAP but that is cumbersome...

can someone from Salesforce comment on this?
I ran in to similar problem. I was trying some Trailhead and was logged in to my Dev Org. I created my domain and deployed it to All Users.
Then I went to My Profile and updated some settings and my profile picture. It was done successfully bu when I tried to View, it suddenly redirected me to somewhere, and their I got this problem - This Site Can't Be Reached - https://<mydomain>'s server DNS address could not be found.

User-added image

When I tried to login salesforce redirected me to following URL:

And showed same error - DNS address could not be found.

My solution was - I removed all other query params except "sid" (Its access token)
My URL became:

I dont know  how it worked, But my logic was simple.
1 - After login - frontdoor.jsp - It was may be trying to redirect to my old page.
2 - Somehow due to some bug from Salesforce, that page was inaccessible and it was giving that DNS error.
3 - I just thought, let the page just login and not to redirect to somewhere with some other query params trying to set some enviornment settings etc.
4 - And then with above stripped URL, I was able to login successfully to my dev org.

Thats it - Hope anyone finds it similar and helpful.

Thanks !

Marcel Peixoto 4Marcel Peixoto 4

I have the same issue and spent two days trying to figure out the issue. I solved changing the login from REST API to SOAP API and it worked fine.


Soap API XML Example

<?xml version="1.0" encoding="utf-8" ?>
<env:Envelope xmlns:xsd=""
   <n1:login xmlns:n1="">
Also,  in the Header of SOAP I have added Content-Type = text/xml and SOAPAction = login