There are a number of ways to authenticate with the Force.com Platform and I thought I’d create a few lightning posts documenting my findingsĀ for each.
The first method in this series will be logging in through the web interface. There are 2 sites that you would hit in order to authenticate:
- http://login.salesforce.com – for Developer Edition and Production Orgs
- http://test.salesforce.com – for all other sandboxes
If you’re not able to log in with a username and password that you know is correct then the first port of call is to check that you’re using the correct URL above. I’ve seen many developers forget to hit ‘enter’ after swapping “test” for “login” (or vice versa) and then being puzzled because their credentials still didn’t work so don’t forget (okay by “many developers” I actually mean me).
There’s also a neat trick that’s quite well-known and can be used to log you in automatically based on bookmarked URLs. All you need to do is append 2 URL parameters onto the appropriate environment HTTPS URL e.g. I could create a bookmark with the URL https://test.salesforce.com?un=wes@cloud-corporation.com&pw=abc123 where:
- un = your username for that environment
- pw = your password for that username
Pro-tip: Make sure that the URL is using HTTPS.
If you exclusively use Chrome you might want to use the Force.com Logins plug-in which will save you some hassle.
As I use IE, Firefox and Chrome, I use LastPass for managing my long, long list of user credentials for all the different Salesforce.com orka.
Things get rather more complicated when you activate the “My Domain” feature in SFDC. For example, our production org is at appirio.my.salesforce.com. When you explicitly log out of SFDC, you’re redirected to the login page, which looks like the screen shot you’ve shown here, but with a URL of https://appirio.my.salesforce.com. If you enter credentials for another org, they’ll fail – inexplicably, at first, until you bang your head against the desk awhile and finally notice the URL. You’ll need to manually point yourself back to http://login.salesforce.com to get back on track. Tricky.
Thanks for the tip!
There’s another way to login if you have a valid sessionID from the API, which is actually what the IDE does when you hit “show in salesforce web”:
https://.salesforce.com/secur/frontdoor.jsp?sid=&retURL=
Very true, thanks very much!
Hi, I used this https://.salesforce.com/secur/frontdoor.jsp?sid=&retURL= format, with a valid accessToken from iOS API, but im showing a login page saying ” You have attempted to access a page that requires login”. Please help.
Thanks
There’s another way to login if you have a valid sessionID from the API, which is actually what the IDE does when you hit “show in salesforce web”:
https://.salesforce.com/secur/frontdoor.jsp?sid=&retURL=