I have a salesforce community that has two URLs, one of which is a custom domain, e.g.

1) mysite.force.com
2) mysite.com

When an Authentication Provider is used (in this case, Facebook) to login, the user is redirected to the force.com domain (mysite.force.com). Is there any way to control this redirect so the /services/authcallback/ endpoint redirects the user to the custom domain instead of the force.com domain?

2 Answers 2


I think you need to use the site parameter, eg:



Site - Enables the provider to be used with a site

  • I am sending the community parameter as opposed to the site one (tried site, no dice), and regardless if I point it at mysite.force.com or mysite.com the redirect is to mysite.force.com.
    – Phil Rymek
    Commented Jan 13, 2014 at 22:09
  • @PhilR Bahhh, damn. And this is set? Site Primary Custom URL. "This is only available on the root path for Force.com and Communities sites" Commented Jan 13, 2014 at 22:26

This one is my mistake :(

It seems like the redirect is based upon the referrer of the request, and has nothing to do with the community parameter.

I was testing this by putting /services/auth/sso endpoint in my address bar, in which case the redirect is indeed always to the force.com domain. Put a link on your site to /services/auth/sso and it will always redirect to the domain of your site upon authorization.

One other issue I encountered here that is worth mentioning is that SSL is not supported with custom domains. However, the /services/authcallback/ will always redirect you to the secure URL for security reasons. Essentially this means you cant use Authentication Providers w/ custom domains, or at least your users will encounter an ugly error message, "This is probably not the page you are expecting!".

  • Is it worth trying to disable Require secure connections (HTTPS) under Setup > Session Settings? Commented Jan 23, 2014 at 16:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .