6
votes

I'm creating an iPhone application that uses salesforce as it's server-side data component, I need to access the database from the application to retrieve data for whichever user logs into the app, to do this I need to authenticate with Sales force.

I'm using the Rest API Template that was available in XCode after installing SalesForce, but I keep getting this:

SalesForce Login UIWebView

Is there any way I can login to salesforce programmatically? I'd like our use of Salesforce to be 'behind the scenes' so to speak, so that our users never have to directly interact with salesforce themselves, is there any way to do this?

2
I would also like to know how to do this, as we are having to do the same thing. I cant seem to find much documentation on how to do it though.boostedz06
Due to time and budget restraints, the company that contracted me for this project decided to go with this login screen, I never solved the problem. I'm sure the OAuth solution below works, but the project manager didn't want me devoting much time to it.Patrick T Nelson
Salesforce webauth is just a poor user experience on iPad, out of the box with their native SDK. Bar appears to tab between fields... really?? No way to get back from the forgot password help video page...really ?? Flashes a blank white screen before the blue page... ugh.Brad Thomas
How did you integrate Salesforce library and showing the login screen? Can you please help. Can you look at following link for more info: salesforce.stackexchange.com/questions/60130/…Ganesh G

2 Answers

4
votes

That looks like the OAuth challenge. You should be able to bypass this by providing a Session Id. In order to get a Session ID, you have to login with the user's username and password. You can use the SOAP API for this.

2
votes

Yes you can do the login behind the scenes.

Follow this Self login in Salesforce API in iPhone?

I was stuck with the same issue and finally figured it out.