0

Can not get token back from OAuth callback URL using CurrentPage.parameters

We have a connected app for which the callback URL is a visualforce page.

https://myapp.na59.visual.force.com/apex/myvfpage#access_token=XSDSDFSDFDI&instance_url=XYZ&id=https%3A%2F%2Flogin.sale

When the callback URL is invoked, Saleforce appends a # at the end of the callback URL and passes a bunch of parameters.

However I can not retrieve any of the parameters e.g $CurrentPage.parameters.access_token gives me a empty string.

Anyone know how to get parameters from a callback URL.

We can get the parameters without any problem from a normal URL (i.e without the #)
Looks like the # breaks the ability of the VF page to get the parameters

  • you can try to use JS to parse URL and get parameters – kurunve Jul 27 '17 at 16:57
  • JS parsing would not be considered safe. – user2324723 Jul 27 '17 at 20:30
  • Any specific reasons why JS parsing would not be considered safe? – kurunve Jul 28 '17 at 6:19

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.