本文介绍了使用node-jira模块时出现身份验证错误401的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 https://github.com/steves/node-jira阅读问题,但是我遇到了错误

I am trying to read an issue using a https://github.com/steves/node-jira , however I am getting an an error

 401: Unable to connect to JIRA during findIssueStatus.

这是我在本地主机上使用以下代码的代码:8433

Here is the code that I am using the code bellow on localhost:8433

var jiraApi = require('jira').JiraApi;

var config = {
    "username": "[email protected]",
    "password": "password",
    "port": 443,
    "host": "company.atlassian.net"
}

var issueNumber = "ABC-1";

var jira = new jiraApi('https', config.host, config.port, config.username, config.password, '2');
jira.findIssue(issueNumber, function(error, issue) {
    console.log('Status: ' + issue.fields.status.name);
});

推荐答案

我刚刚找到了jira api库的源并找到了错误消息.显然,无法连接到jira"实际上意味着无法找到问题".

I just found the source to the jira api library and found the error message.Apparently "unable to connect to jira" actually means "unable to find issue".

    # Unable to find issue
    @jira.request.mostRecentCall.args[1] null, statusCode:401, null
    expect(@cb).toHaveBeenCalledWith(
        '401: Unable to connect to JIRA during findIssueStatus.')


https://github.com/steves/node-jira/blob/master/spec/jira.spec.coffee

好的,没关系.我能够用curl击中jira api,发现我的403访问被拒绝.似乎您的登录名必须打开jira api访问权限,所以很可能就是问题所在.因此它可以连接,但是由于您的登录名无权访问,因此您将被踢出局.

okay, never mind that.I was able to hit the jira api with curl and found I was getting a 403 access denied.It would seem that your login has to have the jira api access turned on so probably that's what's wrong.So it is able to connect, but you're getting kicked out because your login has no access.

这篇关于使用node-jira模块时出现身份验证错误401的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-30 20:41