oAuth handoff back not working


#1

I am trying to get the oAuth authentication working. I am handing off the user to the sandbox like this:

https://api.sandbox.freeagent.com/v2/approve_app?client_id=6KBDBV9WWZKU3eOF4ujFfw&response_type=code&redirect_uri=http%3A%2F%2Fpro.settlit.dev%2Findex.php%3Faction%3Dplacement%26import_type%3D3&state=free_agent

And when I login using my Sandbox user account, I am being asked to Approve my app, however clicking "Approve does not seem to do anything.
In the background I can see that there is a POST done to: https://settlit1.sandbox.freeagent.com/app_approvals?method=post

However it seems like the page itself just refreshes itself.
When I check the user account on FreeAgent, my app is listed as having access.

I must be doing something wrong, but I’m not sure what. Thanks in advance,

Rene


#2

Additionally, all my requests I am doing from the following IP address: 75.99.238.34

I just tried a bunch of times all at 3/6/2017 11:05 EDT


#3

Hi Rene,

I had a quick look at the handoff URL you provided, and it seems on first glance that the redirect_uri is doubly encoded - decoding it gives the following:

http%3A%2F%2Fpro.settlit.dev%2Findex.php%3Faction%3Dplacement%26import_type%3D3

whereas we’d expect decoding the parameter to give

http://pro.settlit.dev/index.php?Faction=placement&import_type=3

(you can reach the expected result by decoding your parameter twice).

If you could try correcting this and let us know if that fixes your problem that would be great.

Kind Regards,
Paul.


#4

Hi Paul, Thank you, that was the issue.