logical-and / php-oauth

Support for authenticating users (without dep from any framework) using both OAuth1 and OAuth2 methods
https://packagist.org/packages/and/oauth
MIT License
43 stars 13 forks source link

Escaping of URL prevents requesting LinkedIn data #46

Open appsol opened 9 years ago

appsol commented 9 years ago

I can get data from LinkedIn using the URL:

people/~:(id,num-connections,num-connections-capped)?format=json

However when using the library, the URL is escaped to produce:

people/~%3A%28id%2Cnum-connections%2Cnum-connections-capped%29

This is rejected by LinkedIn with:

Could not find person based on: ~%3A%28id%2Cnum-connections%2Cnum-connections-capped%29

Is there a way to prevent the URL being escaped before being used?

adamtester commented 9 years ago

I'm having this issue as well, I get that error when I use the CURL request in the web console, but my app is coming back with this error:

array (size=5)
  'errorCode' => int 0
  'message' => string 'Unknown field {~%3A%28first-name%2Clast-name%2Cemail-address%29} in resource {Root}' (length=83)
  'requestId' => string 'asdfghjk' (length=10)
  'status' => int 400
  'timestamp' => int 1435742730817

I have already posted on StackOverflow here: http://stackoverflow.com/questions/31157608/linkedin-api-error-unknown-field-in-resource-root

appsol commented 9 years ago

@log3 I think the issue is with the League\Url package. It's not so much an error as just a requirement to be able to turn off the escaping of URLs. I'll dig into it some more when I get time and see if there is a way to work with it.