如何使用 NodeJS 在跑道中验证用户身份
How to authenticate as an User in Podio using NodeJS
我正在研究 Slack 和 Podio 之间的集成。到目前为止,为了进行一些 API 调用,我一直在对 APP 进行身份验证。现在我发现自己尝试使用视图 API 但我收到以下错误消息:
message: { error_parameters: {},
error_detail: null,
error_propagate: false,
request:
{ url: '<api url>',
query_string: '',
method: 'POST' },
error_description: 'Authentication as app is not allowed for this method',
error: 'forbidden' },
status: 403,
url: '<app url>',
name: 'PodioForbiddenError' }
error_description 让我觉得我需要作为用户进行身份验证,才能访问此 API。这就是我现在进行身份验证的方式:
const Podio = require('podio-js').api;
const podio = new Podio({
authType: 'app',
clientId: process.env.clientId,
clientSecret: process.env.clientSecret
});
我没能找到使用节点进行用户身份验证的示例。js/javascript。我需要生成一个新的 clientId and/or clientSecret 吗?任何人都可以提供一个工作示例吗?
感谢您的宝贵时间!
要通过应用进行身份验证,您需要提供应用 ID 和应用令牌。通过提供 client id 和 client secret,您可以获得跑道客户端,然后您需要使用应用凭据对跑道客户端进行身份验证。喜欢
podio.AuthenticateWithApp(appId, appToken);
您可以从应用的开发者选项卡中获取应用 ID 和应用令牌。
我最终使用了 podio.AuthenticateWithCredentials(userName, password);
我正在研究 Slack 和 Podio 之间的集成。到目前为止,为了进行一些 API 调用,我一直在对 APP 进行身份验证。现在我发现自己尝试使用视图 API 但我收到以下错误消息:
message: { error_parameters: {},
error_detail: null,
error_propagate: false,
request:
{ url: '<api url>',
query_string: '',
method: 'POST' },
error_description: 'Authentication as app is not allowed for this method',
error: 'forbidden' },
status: 403,
url: '<app url>',
name: 'PodioForbiddenError' }
error_description 让我觉得我需要作为用户进行身份验证,才能访问此 API。这就是我现在进行身份验证的方式:
const Podio = require('podio-js').api;
const podio = new Podio({
authType: 'app',
clientId: process.env.clientId,
clientSecret: process.env.clientSecret
});
我没能找到使用节点进行用户身份验证的示例。js/javascript。我需要生成一个新的 clientId and/or clientSecret 吗?任何人都可以提供一个工作示例吗?
感谢您的宝贵时间!
要通过应用进行身份验证,您需要提供应用 ID 和应用令牌。通过提供 client id 和 client secret,您可以获得跑道客户端,然后您需要使用应用凭据对跑道客户端进行身份验证。喜欢
podio.AuthenticateWithApp(appId, appToken);
您可以从应用的开发者选项卡中获取应用 ID 和应用令牌。
我最终使用了 podio.AuthenticateWithCredentials(userName, password);