无法使用授权码获取领英访问令牌

Goa*_*oat 7 authentication oauth linkedin oauth-2.0 linkedin-api

我无法获得 LinkedIn 访问令牌。我的设置如下:

  1. 我已使用此重定向 URL 在 LI 上设置了一个应用程序 http://localhost:5000/home

  2. 我向 LI 请求授权并得到带有“代码”的响应。

  3. 在不到 10 秒的时间里,我将代码查询参数从 URL 栏中复制并粘贴到 Postman 中。

  4. 在邮递员中,我有如下设置:

    POST /oauth/v2/accessToken HTTP/1.1
    Host: www.linkedin.com
    Content-Type: application/x-www-form-urlencoded
    
    grant_type=authorization_code&
    client_id=<client id>&
    client_secret=<client secret>&
    redirect_uri=http%3A%2F%2Flocalhost%3A5000%2Fhome&
    code=AQSbUzcWwSk_3sqQfusRZWEa4tZqU_x4fSQKub9c3eoeCzZwNO2ZH8uAzJc-T0T40WRv6qNxNpCDxckEjuXHqb56ZhKQqReB5mDjm1kZrCrLlBBYhzyymF5oRzwNgObylJukUVQ_0OiSuE0W0RQ
    
    Run Code Online (Sandbox Code Playgroud)

我进行了多次尝试,但作为回应,我收到以下错误。

{"error":"invalid_request","error_description":"Unable to retrieve access token: appid/redirect uri/code verifier does not match authorization code. Or authorization code expired. Or external member binding exists"}
Run Code Online (Sandbox Code Playgroud)

我们有一个 LI 登录部署突然停止工作并开始返回此错误。在简化用例时,我发现 Postman 也是如此。

是什么赋予了?我究竟做错了什么?这曾经有效!