【问题标题】:Python LinkedIn REDIRECT_URIPython LinkedIn REDIRECT_URI
【发布时间】:2020-12-29 07:36:56
【问题描述】:

我应该在哪里找到我的 REDIRECT_URI 以访问 LinkedIn API?我看到了客户端 ID 和密码,但似乎找不到重定向片段。

# Copy the client ID, secret, and redirect URI in the fields below
CLIENT_ID    = 'xxxxxxx'
CLIENT_SECRET = 'xxxxxxxxxxx'
REDIRECT_URI = 'http://localhost:8000'

# Generate a random string to protect against cross-site request forgery
letters = string.ascii_lowercase
CSRF_TOKEN = ''.join(random.choice(letters) for i in range(24))


# Request authentication URL
auth_params = {'response_type': 'code',
               'client_id': CLIENT_ID,
               'redirect_uri': REDIRECT_URI,
               'state': CSRF_TOKEN,
               'scope': 'r_liteprofile,r_emailaddress,w_member_social'}

html = requests.get("https://www.linkedin.com/oauth/v2/authorization",
                    params = auth_params)

# Print the link to the approval page
print(html.url)

【问题讨论】:

  • 问题解决了吗?

标签: python linkedin-api


【解决方案1】:

可以在 Settings 部分找到,如果没有,请查看 AUTH 选项卡。请参阅图片以供参考。

如果您遇到Invalid redirect_uri,请查看 - inkedin : Invalid redirect_uri. This value must match a URL registered with the API Key

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-11-04
    • 1970-01-01
    • 1970-01-01
    • 2021-11-15
    • 2018-02-27
    • 2014-10-25
    • 1970-01-01
    • 2014-12-21
    相关资源
    最近更新 更多