【问题标题】:How to authenticate as an User in Podio using NodeJS如何使用 NodeJS 在 Podio 中验证用户身份
【发布时间】:2017-06-20 21:49:44
【问题描述】:

我正在研究 Slack 和 Podio 之间的集成。到目前为止,我一直在以 APP 身份进行身份验证,以便进行一些 API 调用。现在我发现自己尝试使用 Views 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
});

我找不到使用 node.js/javascript 进行用户身份验证的示例。我是否需要生成新的 clientId 和/或 clientSecret?谁能提供一个可行的例子?

感谢您的宝贵时间!

【问题讨论】:

    标签: javascript node.js podio


    【解决方案1】:

    要对应用进行身份验证,您需要提供应用 ID 和应用令牌。通过提供客户端 ID 和客户端密码,您可以获得 Podio 客户端,然后您需要使用应用凭据对 Podio 客户端进行身份验证。喜欢

     podio.AuthenticateWithApp(appId, appToken);
    

    您可以从应用的开发者选项卡中获取 appid 和应用令牌。

    【讨论】:

    • 您好 Akbar,感谢您的回答。我目前正在以 APP 身份进行身份验证,但我需要以用户身份进行身份验证才能访问 Views API。
    • 那么你需要以用户身份进行身份验证。为此,您需要使用用户身份验证。例如:code podio.AuthenticateWithPassword(userName, password);
    • 我可以使用podio.AuthenticateWithCredentials(userName, password);
    【解决方案2】:

    我最终使用了podio.AuthenticateWithCredentials(userName, password);

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-11-26
      • 1970-01-01
      • 1970-01-01
      • 2020-02-28
      • 2018-10-26
      相关资源
      最近更新 更多