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
João GloriaJoão Gloria 

Redirect to salesforce homepage

We have an external login service and, on login success, we want to redirect the users to our app within Salesforce:
https://our-app-name.sf-server.visual.force.com/apex/our-app-homepage

The problem is that the sf-server is arbitratry.
How to fix this? If we redirect to login.salesforce.com, the user still needs to click his username and then open our app within Salesforce.
We'd like to just redirect to our app.
Thanks!
GarrettzGarrettz
If I understand what you are trying to do, this should do the trick for you.

You will need to put your VF page on a site - this will remove the apex path as well as the sf-server.visual.force domain. Instead it should make your domain something like https://our-app-name.force.com/site-name

The other piece of this is to have include the startURL parameter in your login service URL (https://help.salesforce.com/articleView?id=sso_provider_addl_params_start.htm&type=5). This redirects the user to the url value of the parameter after authentication. You'll most likely want the full URL to sit behind a more simple URL that redirects... www.company.com/login -> www.company.com/auth?startURL=https://our-app-name.force.com/site-name