使用LinkedIn oauth2.0与rauth

时间:2013-05-23 18:53:41

标签: oauth-2.0 linkedin rauth

我正在尝试使用rauth提供的OAuth2Service连接到LinkedIn。 我成功检索了访问令牌。为此,我为json响应配置了一个特定的解码器。

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

但是在通过API进行API调用时 r = session.get('people/~', data={"x-li-format":'json'},) 以下回复:

<?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>

LinkedIn是否可能不支持不记名令牌?如果是这样,rauth是否支持其他计划?

1 个答案:

答案 0 :(得分:3)

Rauth支持通过传递bearer_auth=Falsesee the documentation来关闭默认的基于标头的身份验证。这应该纠正行为不当的提供程序的问题,这些提供程序要么不支持基于标头的身份验证,要么不正确地实现它。希望有所帮助!