0

I am implementing the /auth/authorize portion of the oAuth instructions here => https://github.com/SciDevs/delicious-api/blob/master/api/oauth.md#authauthorize.

I would like to start out by saying there's no problem with authentication if the redirect uri I use for authentication is a regular uri like this => http://www.example.com. The API will send me back the code I need in this format => http://www.example.com?code=blablabla .

But if the redirect uri has GET parameters attached like this => http://www.example.com?var1=abc&var2=def, the API will send me back the code I need in this format => http://www.example.com?var1=abc&var2=def?code=blablabla which is of course wrong.

Has anyone encountered this issue? If yes, has anyone solved this?

Paolo
  • 390
  • 2
  • 5
  • 20
  • Did you URL-encode your redirect_uri value properly when passing it to their endpoint? If so, then I’d say the error is on their part, so file a bug report through what ever channel they provide for that. – CBroe Aug 27 '14 at 14:31
  • I tried you're suggestion and the problem became worse! It seems the API I can't handle encoded versions and cannot recognize the url. I guess the API is a mess because there are a lot of open issues on Github. – Paolo Aug 28 '14 at 04:36

1 Answers1

0

This is more of a hack that a real solution but it works.

Since I do get the code back (or more importantly its value), I just parse it from the URL. For example, using the example I used above, here are the $_GET variables I would have:

$_GET['var1'] = 'abc' and $_GET['var2'] = 'def?code=blablabla'

What I'd do is:

list($var2, $code) = explode("?code=", $_GET['var2']);

... and I'll still get the code I need to acquire an access token.

Paolo
  • 390
  • 2
  • 5
  • 20