Xero JWT audience



当我试图解码认证后收到的access_token时,我需要一个听众。

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

收到的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

最新更新