我正在使用我的客户端ID和客户端密钥,代码如下:
https://github.com/DEKHTIARJonathan/python3-linkedin/blob/master/examples/oauth2_authentication.py
但是,在命令行中获取url并将其放入浏览器时,我得到了“无效的redirect_uri。此值必须与API密钥注册的URL匹配。”
为了让它正常工作,我已经在注册以下重定向URL:
为了让它正常工作,我已经在注册以下重定向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
然而,添加最后的“signin-linkedin”并没有解决问题。
这是我得到的URL,#代替了我的client_id:
提前感谢您的帮助。
编辑:
我根据其他帖子尝试添加了一些额外的URL:
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)