【问题标题】:Matching code was not found or was already used未找到匹配代码或已被使用
【发布时间】:2019-11-09 09:56:51
【问题描述】:

我正在尝试使用 Instagram OAuth 使用开发者文档在

https://developers.facebook.com/docs/instagram-basic-display-api/getting-started

第 1 步和第 2 步工作正常,所以我有我的 Client-ID、Client-Secret、Redirect-URI 和代码。

18 我正在尝试使用 Instagram OAuth 使用开发人员文档在

https://www.instagram.com/developer/authentication/.

第 1 步和第 2 步工作正常,所以我有我的 Client-ID、Client-Secret、Redirect-URI 和代码。

但每次我尝试获取访问令牌时都会收到以下错误:

{ “代码”:400, "error_type": "OAuthException", "error_message": "匹配代码未找到或已被使用。" }

任何提示如何解决这个问题?

【问题讨论】:

    标签: ios api instagram


    【解决方案1】:

    按照您发布的 Facebook 链接而非 Instagram 中的说明进行操作(它们不适用于新 API):

    用户授权重定向:

    https://api.instagram.com/oauth/authorize
    ?app_id={app-id}
    &redirect_uri={redirect-uri}
    &scope=user_profile,user_media
    &response_type=code
    

    将返回的代码交换为令牌:

    curl -X POST \
    https://api.instagram.com/oauth/access_token \
    -F app_id={app-id} \
    -F app_secret={app-secret} \
    -F grant_type=authorization_code \
    -F redirect_uri={redirect-uri} \
    -F code={code}
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-11-10
      • 2015-07-03
      • 2020-09-05
      • 2018-10-29
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多