Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple Authorization error #25

Open
brokencube opened this issue Mar 14, 2016 · 6 comments
Open

Multiple Authorization error #25

brokencube opened this issue Mar 14, 2016 · 6 comments

Comments

@brokencube
Copy link

A recent pull request has added the following line to the ->fetch() method

$headers[] = 'Authorization: Bearer ' . $this->getAccessToken();

This is now causing the LinkedIn API to error with the message "Mutiple authentication schemes detected" [sic] as the token is included both in a header and on the query string.

@rmuilwijk
Copy link

This issue is blocking alot of calls which made us use an older revision for now.

@ashwinks
Copy link
Owner

So is that Authorization bearer header not required? It was a pull request from #24

The project that this class was used on is dead, so I don't have a codebase to test this on. Would anyone like to take it over?

@dannydohmen
Copy link

With the Authorization bearer header there are more Authorization headers.

RuntimeException: Request Error: Mutiple authentication schemes detected. Raw Response: Array ( [errorCode] => 0 [message] => Mutiple authentication schemes detected [requestId] => 0DIXRCG17P [status] => 401 [timestamp] => 1458637918306 ).

In the documentation i can find this. ( https://developer.linkedin.com/docs/rest-api )

If it is more convienent for your application to work with data in JSON format, you can request that APIs return you JSON data using one of the following methods:
Add a format=json URL argument to the end of your API call.
Add this HTTP header to your API call: x-li-format: json

For example:
GET
https://api.linkedin.com/v1/people/~?format=json

So maybe there is a difference for xml and json requests to linkedin regarding to the headers.

@digitalhydra
Copy link

If you remove the header Authorization: Bearer from the fetch method then the request return the data.
at least it works for me.

@desnudopenguino
Copy link

I second @digitalhydra Commenting out that line lets it work.

@cbaldwin74
Copy link
Contributor

cbaldwin74 commented Apr 20, 2016

According to the LinkedIn documentation https://developer.linkedin.com/docs/oauth2 Step 4 says the Authorization header is the proper way to authenticate your requests. The Multi authentication scheme error can be avoided by removing the oauth2_access_token query parameter. Once that is removed the the requests will work.

I have created a Pull Request for this fix. #29

psimika added a commit to psimika/secure-web-app that referenced this issue Sep 1, 2017
The error returned was 401 "Mutiple authentication schemes detected" and
it was caused because in the API request we were adding the parameter
&oauth2_access_token= as suggested by Caserta (2015).

http://pierrecaserta.com/go-oauth-facebook-github-twitter-google-plus/

Once that parameter was removed, the API returned the user data.

See: ashwinks/PHP-LinkedIn-SDK#25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants