3

I'm trying to setup a custom force.com site VF page that will allow standard user logins to multiple orgs on different domains.

My site lives on an na12 org, and the login for that site works correctly. I'm using the ajax toolkit to submit the UN/PW+token to get the session ID then redirecting to the frontDoor.jsp page.

I'm basically following this example: https://github.com/BPeddle/SFDC.Custom.Login/blob/master/custom_login.page

My issue is I'm getting an invalid login error when trying other logins to different orgs. Any suggestions? I've tried adding the force.com site URL to remote site settings in the other orgs, adding its IP to the whitelist IP list, neither seem to make a difference.

0

I think the problem is that the login request should (in general) go to login.salesforce.com, rather than a specific instance. Since you can't open a connection to login.salesforce.com, due to JavaScript's same origin policy, you might consider passing the username and password to the page controller, doing the login from there, then redirecting to frontdoor.jsp via the returned PageReference.

  • Thanks, yeah I just tested doing the SOAP call from Apex to get the session ID and endpoint and building the redirect from those, that seems to work. – Phil B Jan 27 '14 at 3:42
0

I think from outside URLs you need to make use of SAML or OAuth 2.0 that Salesforce already provides for making Single Sign-on functionality as Connected Applications.

  • The Ajax toolkit is just utilizing the SOAP API. Why wouldn't this be available from outside URLs? – Phil B Jan 24 '14 at 20:04
  • Sorry for replying late but it seems it might help you logging-in from outside using URL Redirect: test.salesforce.com.sandbox?loginType=2&un=abc@xyz.com&…. Where test.salesforce.com is the type of Sandbox Account, un is Username and pw is password of your account. Let me know if it still can be considered. – sanchit Jan 29 '14 at 12: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.