0

I'm developing Salesforce iOS application.

From the application frequently the user has to modify data which is available on Salesforce.com.

When a user taps on edit I'm launching salesforce login screen and prompting to enter username and password all the time.

So I have decided to implement SSO using Salesforce Oauth. I have done everything I'm able to receive an access_token once user is authenticated with Salesforce.com.

My question is - lets say "If the user want to edit a lead with id as 0097hjy7", URL to edit this lead will be "https://sales.mysalesforce.com/0097hjy7" when this URL launch on browser it prompt to enter username and password again.

How can I navigate the user to "https://sales.mysalesforce.com/0097hjy7" this URL without asking username and password all the time by using the access_token available with me?

2 Answers 2

0

As of Winter '14 (prior is sort of unsupported)

https://{instance}/secur/frontdoor.jsp?sid={the_Access_token}&retURL={optional_relative_url_to_open}

Not sure how it works with the mysalesforce domain.

2
  • Eric, Thank you, May I know what is the "retURL" is ?
    – AskIOS
    Oct 17, 2014 at 7:49
  • Works like a charm. It saved my 3 days of effort.
    – AskIOS
    Oct 17, 2014 at 7:59
0

Use the following line which will be available on Salesforce iOS SDK.

NSURL * url = [SFAuthenticationManager frontDoorUrlWithReturnUrl:[NSString stringWithFormat:@"?sid=%@",] returnUrlIsEncoded:YES]

Launch the web browser with this URL.

[[UIApplication sharedApplication] openURL:url];

You must log in to answer this question.

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