t_-_t
t_-_t

Reputation: 128

Using LinkedIn oauth2.0 with rauth

I am trying to connect to LinkedIn using the OAuth2Service provided by rauth. I successfully retrieve the access token. To do so, I configured a specific decoder for the json response.

json_decoder = json.loads
params = {'decoder': json_decoder}
session = linkedin.get_auth_session(data=data, **params)

But when doing the API call via r = session.get('people/~', data={"x-li-format":'json'},) the following response is coming back:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<error>
  <status>401</status>
  <timestamp>1369334215190</timestamp>
  <request-id>F3SKIP4YUF</request-id>
  <error-code>0</error-code>
  <message>Unknown authorization header {Bearer AQU2HxhdXVHGG4sIWdZV7siahjVyTz0KIigEVvtMpAh...}
</message>
</error>

Is it possible that LinkedIn does not support the bearer token? If so, does rauth support other schemes?

Upvotes: 2

Views: 966

Answers (1)

maxcountryman
maxcountryman

Reputation: 1769

Rauth supports turning off the default header-based authentication by passing in bearer_auth=False, see the documentation. This should correct problems with misbehaving providers that either don't support header-based authentication or implement it improperly. Hope that helps!

Upvotes: 2

Related Questions