【发布时间】:2018-08-14 19:46:56
【问题描述】:
我正在将此代码与我的客户端 ID 和客户端密码一起使用:
https://github.com/DEKHTIARJonathan/python3-linkedin/blob/master/examples/oauth2_authentication.py
但是,当在命令行中获取 URL 并将其放入浏览器时,我得到“无效的 redirect_uri。此值必须与使用 API 密钥注册的 URL 匹配。”
我已经使用重定向网址注册了以下内容以尝试使其正常工作:
http://localhost:8080/code
https://localhost:8080/code/
http://localhost:8080/code/signin-linkedin
https://localhost:8080/code/signin-linkedin
https%3A//locahost%3A8080/code/
signin-linkedin 片段来自这里:
linkedin : Invalid redirect_uri. This value must match a URL registered with the API Key
但是,添加最后一个 'sigin-linkedin' 部分并不能缓解问题。
这是我要返回的 URL,# 代替我的 client_id:
提前致谢。
编辑:
我尝试根据其他帖子添加一些额外的网址:
https://appname.auth0.com/login/callback
这是我的代码:
if __name__ == '__main__':
CLIENT_ID = #######
CLIENT_SECRET = ##########
RETURN_URL = 'http://localhost:8080/code/'
authentication = LinkedInAuthentication(
CLIENT_ID,
CLIENT_SECRET,
RETURN_URL,
permissions=['r_basicprofile',
'r_emailaddress',
'rw_company_admin',
'w_share']
)
print(authentication.authorization_url)
application = LinkedInApplication(authentication)
【问题讨论】:
标签: python linkedin linkedin-api