【问题标题】:Connecting to Revolut sandbox连接到 Revolut 沙箱
【发布时间】:2020-05-06 11:34:25
【问题描述】:

我正在尝试创建与 Revolut 的客户端连接。我正在关注他们的 tutorial,但是我被困在 Exchange 授权码

到目前为止我做了什么:

  1. 在他们的sanbox 上创建了企业帐户
  2. 在这里添加了我的公钥https://sandbox-business.revolut.com/settings/api
  3. 通过启用 API 访问您的帐户激活了我的 API 证书(我完成了所有步骤并获得了现在启用访问的信息),但是我仍然可以在我的 API 证书上看到 Access is not enabled
  4. 创建 JWT 令牌并使用我的私钥对其进行签名(使用 https://jwt.io/ 进行验证)
  5. 像这样发送访问令牌请求(通过邮递员完成):

    curl --request POST \
      --url https://sandbox-b2b.revolut.com/api/1.0/auth/token \
      --header 'Accept: */*' \
      --header 'Accept-Encoding: gzip, deflate' \
      --header 'Cache-Control: no-cache' \
      --header 'Connection: keep-alive' \
      --header 'Content-Length: 596' \
      --header 'Content-Type: application/x-www-form-urlencoded' \
      --header 'Host: sandbox-b2b.revolut.com' \
      --header 'User-Agent: PostmanRuntime/7.20.1' \
      --header 'cache-control: no-cache' \
      --data 'grant_type=authorization_code&code=oa_sand_xxx&client_id=xxx&client_assertion_type=xxx&client_assertion=xxx
    

但是响应是:

{
    "error": "unauthorized_client",
    "error_description": "Incorrect request token"
}

现在我不确定我在请求访问令牌时做错了什么,还是由于第 3 步,我的 API 证书的激活似乎很顺利,但后来我发现它没有激活。您能否验证我的步骤以帮助我确定问题出在哪里?

【问题讨论】:

    标签: jwt authorization auth0 jwt-auth


    【解决方案1】:

    原来授权码仅在 2 分钟内有效,在那之后您必须请求另一个。

    【讨论】:

    • 每次生成新代码时,我仍然会收到相同的输出。你做了什么来绕过这个错误?
    • 我的问题是,我正在复制最后一个空查询字符串参数以及生成的代码。修好了。
    猜你喜欢
    • 2021-01-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-02-25
    • 2018-05-22
    • 2011-02-18
    相关资源
    最近更新 更多