You need to sign in to do that
Don't have an account?
akhilesh_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?
listerrr
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]
```
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_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];
[[SFAuthenticationManager frontDoorUrlWithReturnUrl:urlPath returnUrlIsEncoded:NO] absoluteString];
listerrr
No, it does not work even with desktop browser.
Also thanks for the method, I somehow missed it.
Also thanks for the method, I somehow missed it.
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.
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