3

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

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

https://login.salesforce.com
/services/auth/sso
/[your_org_id]
/[your_auth_provider]
?site=http%3A%2F%2Fmysite.com%2F
&startURL=[relative_start_url]

https://help.salesforce.com/HTViewHelpDoc?id=sso_authentication_providers.htm&language=en_US

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 Jan 13 '14 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" – bigassforce Jan 13 '14 at 22:26
2

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? – bigassforce Jan 23 '14 at 16:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.