我是Python的新手,我想测试Linkedin API。 我从这个网站获得的认证码(使用的oauth2)的例子:https://github.com/ozgur/python-linkedin验证到linkedin API
我想没有什么不对的配置我的LinkedIn应用:
ID客户:XXX
揭秘客户:YYY
所有这些箱子被检查:r_basicprofile,r_emailaddress,rw_company_admin,w_s野兔
的OAuth 2.0 =>授权URL:http://localhost:8000
下面是代码:
#-*- coding: utf-8 -*-
from linkedin import linkedin
API_KEY = 'XXX'
API_SECRET = 'YYY'
RETURN_URL = 'http://localhost:8000'
authentication = linkedin.LinkedInAuthentication(API_KEY, API_SECRET, RETURN_URL)
print "authentication.authorization_url : " + authentication.authorization_url
print "authentication.key : " + authentication.key
print "authentication.secret : " + authentication.secret
print "authentication.redirect_uri : " + authentication.redirect_uri
print "authentication.state : " + authentication.state
print authentication.authorization_code
print authentication.token
print authentication._error
application = linkedin.LinkedInApplication(authentication)
,其结果是:
authentication.authorization_url:https://www.linkedin.com/uas/oauth2/authorization?scope=&state=a2eb48d9b7b5f94a24dfbf36d498ebdc&redirect_uri=http%3A//localho ST% 3A8000 & response_type = code & client_id = XXX
authentication.key:XXX
authentication.secret:YYY
authentication.redirect_uri:http://localhost:8000
authentication.state:a2eb48d9b7b5f94a24dfbf36d498ebdc
无
无
无
我不明白为什么我的authorization_code是None。根据git hub链接,redirect_url应该包含URL +授权码。这里我只有URL,所以我无法继续验证过程。
我做了一些研究,但我无法找到任何东西。有人知道我的代码或配置有什么问题吗?
谢谢!