0

We have developed a native iOS mobile app that connects to Salesforce, users login through this native app using OAuth user-agent flow and a connected App.

This all works fine.

We are now trying to embed an authenticated visualforce page into the app in a hybrid pattern. As the user is already authenticated we want to re-use this to access the visualforce page.

The following extract from this document says that we can do this by appending &oauth_token to the url. I have already added visualforce to the scope of the connected app. However this does not seem to work as we are always redirected to login.salesforce.com. The document is a little dated and I can find no other postings on this matter. Does anyone have more detail or an updated approach.

Once the user logs in successfully, you can then append the OAuth access token to a VF URL and direct users to it (for e.g. ‘https://c.cs0.visual.force.com/apex/HelloWorld?oauth_token=’)

  • Do you have the correct instance URL, replace https://c.cs0.visual.force.com with your Salesforce instance URL? – Raul Nov 21 '17 at 21:34
  • Im using the my.salesforce url as this is the url that is returned in the oauth response. **Note my VF is in a managed package so the page also has a namespace. To the end of this url I add some other parameters and then the &oauth_token=xxx ee-test-eposly.my.salesforce.com/apex/mpos__EposProductInfo – dacology Nov 21 '17 at 21:36

Your Answer

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

Browse other questions tagged or ask your own question.