function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
listerrrlisterrr 

Salesforce RetUrl Stripped query string

Hi,

I'm trying to use create contact with prefilled info. But there is an issue when i use frontdoor.jsp with retURL. It does not redirect to the url given in query string retURL.

ap1.salesforce.com/secur/frontdoor.jsp?sid=<REALLY_LONG_OAUTH_TOKEN_HERE>&retURL=003/e?name_firstcon2=palani&name_lastcon2=raja

At the moment it strips everything after first query parameter

it redirects to ap1.salesforce.com//e?name_firstcon2=palani ignoring name_lastcon2=raja

 

 

Duplicating it here - github.com/forcedotcom/SalesforceMobileSDK-iOS/issues/391

akhilesh_sfdcakhilesh_sfdc
Are you using iOS mobile SDK and it's Oauth implementation for login? Can you provide more information on how you are generating this url and how are you redirecting the user?
listerrrlisterrr
Yes, I'm using iOS Mobile SDK with OAuth Implementation. I have an option within the app to open safari when they try to create a contact.

Instead of asking the user to login again in safari, I'm trying to use secur/frontdoor.jsp to redirect the user with the oauth token.

Here is the code which i use to construct the url.

```
//get the OAuth credentials
SFOAuthCoordinator *coord = [[SFRestAPI sharedInstance] coordinator];

//construst NSString url with instance URL and the session ID
NSString * urlString = [NSString stringWithFormat:@"%@/secur/frontdoor.jsp?sid=%@&retURL=%@", [[coord credentials] instanceUrl], [[coord credentials] accessToken], salesforceURL]
```
akhilesh_sfdcakhilesh_sfdc
Does this URL structure on a regular desktop browser? Also make sure that you have the web oauth scope enabled. BTW, you can also use this utility method to generate this url.

[[SFAuthenticationManager frontDoorUrlWithReturnUrl:urlPath returnUrlIsEncoded:NO] absoluteString];
listerrrlisterrr
No, it does not work even with desktop browser.

Also thanks for the method, I somehow missed it.