2

I need created custom login page for my mobile app without using token.

I considered the following solutions:

  • h++ps://login.salesforce.com?un="+username+"&pw="+password+"&startURL=/apex/somepage That will work, but if you enter an invalid username and password you get sent back to the standard SFDC login.

  • I found solution (http://brianpeddle.com/2011/06/06/building-a-custom-salesforce-login/), but in this solution need enter password + security token. It is not possible for me.

  • Go to Setup->Security Controls->Network and enter the IP address or address range of your server. Login attempts from white-listed IP addresses do not require a security token, but this solution is not suitable, because it is mobile app and I do not know ip range.

Could you help me?

  • What about white-listing all of the IP addresses on the user profile: 0.0.0.0 - 255.255.255.255 ? – martin Nov 28 '15 at 14:18
  • Unfortunately this solution is not appropriate for me – Dzmitry Nov 28 '15 at 17:01
  • Have you app connect to a heroku middleware app that handles the login and passing of parameters. You can better control what is sent back to the mobile device that way. Just throwing it out there as a possibility – Eric Nov 28 '15 at 17:25
0

What you could try doing is setup Connected App and Community, then call authorisation URL with login_hint parameter which you can access from your custom controller. Then return PageReference to a Site.Login() method where you enter split up credentials from login_hint parameter.

Obviously if you are going this length it will be much better practice just to serve community login page inside WebView.

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.