3

I'm working on the Mobile app development. Here is my issue:

  1. We have got a token through the OAuth flow in App using SDK.

  2. There is a link in app named "user info", user tap that link and open a local browser and see what he wish to see in that browser without log in again.

Step 1 is OK, my question is there any solutions for step 2 ?

I mean can I use the token authorized in Mobile APP to access web salesforce in local browser without log in again ?

If it does, hope to provide some relevant reference or samples. Thank you very much!

0

It is possible by frontdoor.jsp page. You need to navigate user to following url on button click:

https://instance.salesforce.com/secur/frontdoor.jsp?sid=access_token&retURL=start_page

  • instance is the Salesforce instance i.e; na9
  • access_token is the token you got from OAuth flow
  • retURL is the start page you want to show on login

Note: You have to provide web scope in OAuth flow.

  • Thanks for you answer Regal. I think the "secure/frontdoor.jsp" should be "secur/frontdoor.jsp". I test it many times, it seems not work as before. I set the OAuth scope as "Access and manage your data(api),Provide access to your data via the Web(web),Full access (full)". Then I got the access_token in App SDK "abcdef", and visit URL in browser "na1.salesforce.com/secur/frontdoor.jsp?sid=abcdef"(na1 is my instance). The browser navigate to "na1.salesforce.com/saml/authn-request.jsp?request_id=...&..." and pop a dialog tell me to input username and password. – Robin Li Apr 1 '14 at 5:05
  • @RobinLi Yes, it should be "secur/frontdoor.jsp". – Ashwani Apr 1 '14 at 8:32
  • Do you have a working example of this? I experience the same behavior as Robin, even when my scope contains web and full. – Phil Rymek May 1 '14 at 14:26
  • Maybe an encoding issue? Do you need to URL encode the access token? I can't remember if there are sometimes characters that are not URL safe. – metadaddy Sep 30 '14 at 2:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.