【问题标题】:Trello API authentication popup not closedTrello API 身份验证弹出窗口未关闭
【发布时间】:2016-03-29 16:08:55
【问题描述】:

我正在尝试演示 Trello API,但我遇到了身份验证过程的问题。

var ConnectToTrello = function () {
//console.log("Authenticating");
Trello.authorize({
    type: 'popup',
    name: 'Outlook Trello Add-In',
    scope: { read: true, write: true, account: true },
    success: authenticationSuccess,
    error: authenticationError
});};

这会打开一个弹出窗口,我可以在其中进行身份验证,然后我被重定向(在弹出窗口中)到 https://trello.com/1/token/approve 并且没有任何反应。弹出窗口没有关闭。

任何帮助将不胜感激。

下载the code here

【问题讨论】:

  • authenticationSuccess 和 authenticationError 的正文是什么?
  • var authenticationSuccess = function (response) { console.log(response); $('#btnAuthenticate').hide(); } var authenticationError = function (error) { console.log(error); }
  • 我添加了源代码here
  • @Web_Designer 你最终解决了这个问题吗?
  • 我也面临同样的问题。成功了吗?

标签: javascript microsoft-edge trello


【解决方案1】:

在使用type: 'popup' 时,我遇到了标签在某些浏览器中无法关闭的问题。您可以改用type: 'redirect' 吗?我用这种方法取得了更大的成功。

【讨论】:

  • 很遗憾我不能使用重定向。
  • 我也有同样的问题,改用重定向而不是弹出窗口对我没有帮助
  • 遇到同样的问题......任何帮助
【解决方案2】:

在我尝试从按钮运行 ConnectToTrello 函数之前,我遇到了同样的问题。如果您使用在 <script> 块中执行的 javascript sn-p 创建一个简单的页面,它会表现出您描述的行为。

但是,如果您添加一个具有该功能的简单按钮作为 onclick 事件处理程序,那么它就可以正常工作。

<button onclick="ConnectToTrello();">press me!</button>

【讨论】:

    【解决方案3】:

    我遇到了同样的问题,并发现这是因为我试图从 file:// URL 进行授权。 然后我通过 Eclipse 通过 HTTP Preview 托管了相同的 URL,它开始按预期工作。

    注意:我还使用了这个 Trello.authorize 调用所期望的令牌。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-06-24
      • 2021-10-25
      • 2020-08-28
      • 2019-05-15
      相关资源
      最近更新 更多