Linkedin API-错误的重定向,无效的重定向URI

das*_*otz 8 python linkedin linkedin-api

我将此代码与我的客户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/
Run Code Online (Sandbox Code Playgroud)

登录-linkedin片段来自这里:

linkedin:无效的redirect_uri。该值必须与使用API​​密钥注册的URL匹配

但是,添加最后一个“ sigin-linkedin”部分并不能缓解问题。

这是我要返回的URL,用#代替我的client_id:

https://www.linkedin.com/uas/oauth2/authorization?response_type=code&client_id=##########&scope=r_basicprofile%20r_emailaddress%20rw_company_admin%20w_share&state=04377850f3154ee3f​​808f762244697b6&redirect_uri=80%A3A/ /码/

提前致谢。

编辑:

我尝试根据其他帖子添加一些其他网址:

https://appname.auth0.com/login/callback

https://appname.auth0.com

这是我的代码:

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)
Run Code Online (Sandbox Code Playgroud)

and*_*yrd 3

您的回调 URL 配置似乎有错误,缺少“l”。

如果仔细观察该redirect_uri参数,它的值是https%3A//locahost%3A8080/code/未转义的 is https://locahost:8080/code/

我假设您的意思是要配置为的值https://localhost:8080/code/