Question

How to get a security token for iPhone app when the user has reset his security token on the desktop side?

In my iPhone app I hard-coded the security token for authentication and login into the salesforce account.

Any solution?

Was it helpful?

Solution

User will get email with new token, he should be able to type it in your app same way he enters username & password...

Alternative would be to use "trusted networks" - you could tell Salesforce that API login attempts coming from certain IP ranges are safe and don't need the token. This works great for desktops (i.e. network admin just lets people on company network to log in without tokens) but for mobile devices... I guess you could always set trusted network to cover all IP addresses but that's not the safest option.

Check Administration Setup - Security Controls - Network Access

If you'll decide to set whole world as trusted network, you can always later fine tune it to exclude certain ranges of IPs in the Network Access menu or on the Profile level you can specify business hours & valid IPs from which "this" Profile can log in

OTHER TIPS

You should look at the oAuth2 options, which don't require the use of the api security token.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top