【发布时间】:2020-01-30 20:30:59
【问题描述】:
我目前已经使用xero-node sdk 包实现了一个 NodeJs,express api,我遇到了一个问题,似乎没有使用 OAuth 状态参数(尽管我看到它已定义作为 XeroClient 构造函数的可选参数:
export interface IXeroClientConfig {
clientId: string,
clientSecret: string,
redirectUris: string[],
scopes: string[],
state?: string
}
谁能确认这是否已经实施?
我假设它会像这样工作:
const xero = new XeroClient({
clientId: xeroParams.clientId,
clientSecret: xeroParams.clientSecret,
redirectUris: [xeroParams.redirectUrl],
scopes: xeroParams.scopes.split(' '),
state: this.callback_state,
});
//then when building the consent url like this, the state param would be included
const consentUrl = await xero.buildConsentUrl();
然后当回调被触发时,我期望能够访问state code 作为查询参数之一。类似的东西解释了here
我看到返回了 session_state 参数,但这与我提供的状态代码不匹配。
【问题讨论】: