【问题标题】:Xero JWT audienceXero智威汤逊观众
【发布时间】:2023-03-10 07:01:01
【问题描述】:

我在尝试解码身份验证后收到的 access_token 时需要听众。

我似乎找不到任何关于该受众应该是什么的文档。我尝试使用我的 client_id 无济于事。应该是https://identity.xero.com/resources

【问题讨论】:

  • 您好 Serj,如果您能澄清您的问题,我可以在答案中添加更多细节。但是 API 确实提供了一个受众(“aud”),因此在收到响应后似乎出现了问题。您使用的是什么语言/平台/sdk?

标签: xero-api


【解决方案1】:

收到的 JWT 令牌应如下所示:

{
    "nbf": 1589363023,
    "exp": 1589364823,
    "iss": "https://identity.xero.com",
    "aud": "https://identity.xero.com/resources",
    "client_id": "91E5715B1199038080D6D0296EBC1648",
    "sub": "a3a4dbafh3495a808ed7a7b964388f53",
    "auth_time": 1589361892,
    "xero_userid": "1945393b-6eb7-4143-b083-7ab26cd7690b",
    "global_session_id": "ac2202575e824af3a181c50fcaa65c3c",
    "jti": "4e7747cec4ce54d6512b4b0775166c5f",
    "authentication_event_id": "d0ddcf81-f942-4f4d-b3c7-f98045204db4",
    "scope": [
      "email",
      "profile",
      "openid",
      "accounting.transactions",
      "accounting.settings",
      "offline_access"
    ]
  }

如您所见,aud 令牌已按您的预期设置为 https://identity.xero.com/resources

您可能想要检查您用来与 API 交互的包装器/sdk 是否在显示对象之前没有解析出这些详细信息。

在文档中阅读更多信息:https://developer.xero.com/documentation/guides/oauth2/auth-flow#4-receive-your-tokens

【讨论】:

    猜你喜欢
    • 2021-07-15
    • 2016-09-21
    • 2017-01-30
    • 2020-12-27
    • 2015-05-25
    • 2015-04-03
    • 2015-10-16
    • 2018-07-14
    • 1970-01-01
    相关资源
    最近更新 更多