1
votes

I have set up the custom login page for my application using the following resource.

http://brianpeddle.com/2011/06/06/building-a-custom-salesforce-login/

However this approach requires security token for each user if the user is in untrusted network and the security token changes when user reset password.

How can I set up so that I allow multiple user login from this page? Currently only I can think of is have an extra input box so that user past the security token along with username and password. I wonder if salesforce allow javascript to grab security token dynamically for each user

3

3 Answers

1
votes

OAuth2 is a security implementation that allows users to access their Salesforce data without having to enter their user/password in an untrusted application or do nasty token management themselves.

Salesforce has a guide on how to implement OAuth2 for web sites. It can be difficult to set up if you don't have any experience with OAuth2, but there are plenty of guide available.

I would also recommend using something like Firefox's RESTClient addon (or something like it) to test the use of OAuth2 to get a feel for authenticating against Salesforce .

0
votes

Are you sure you have white listed the IP?

I strongly belive if you get the IP of server where your custom login page is hosted and put that in list of white listed IP's then User will not required to enter their security token.

to find the ip of your server(where your page is hosted) - try to login with your custom login page - login into SFDC and go to setup -> user profile-> login history

there you will see last login from IP

Copy above IP and

Again go into Setup -> Security control -> Remote site setting

and add above copied IP.

this way SF will not required security token when user is login from that IP.

http://ap1.salesforce.com/help/doc/en/configuring_remoteproxy.htm

0
votes

Use this code for just login:

https://login.salesforce.com?un="+username+"&pw="+password+"&startURL=/apex/somepage