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: - ?
    – martin
    Nov 28, 2015 at 14:18
  • Unfortunately this solution is not appropriate for me
    – Dzmitry
    Nov 28, 2015 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, 2015 at 17:25

1 Answer 1


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.

You must log in to answer this question.

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