我正在尝试在Python-jira的帮助下执行基本身份验证,并编写了以下代码
from jira import JIRA
SERVER="https://jira.company.com"
user = user@company.com
apikey='api_token'
class create_issue:
def check_authentication(self):
print("inside the check authentication method@@@@@@@")
jira = JIRA(options, basic_auth=(user, apikey)) # username is email-ID and apikey is the JIRA api-token
ci= create_issue()
ci.check_authentication()我收到以下错误
WARNING:root:Got recoverable error from GET https://jira.company.com/rest/api/2/serverInfo, will retry [1/3] in 13.772170596345521s. Err: 401 之前尝试使用不推荐使用的用户名和密码,后来更改为api_key而不是密码。但还是会遇到问题。有人能帮上忙吗。当我在网站上使用相同的身份验证时,它是有效的。
谢谢,Punith
发布于 2020-03-28 06:09:09
他们的文档表明,在使用基本身份验证时,您应该使用用户名和密码,而不是apikey。
https://developer.atlassian.com/server/jira/platform/basic-authentication/
在引入类之前,坚持使用一些简单的东西来确保它可以工作。
from jira import JIRA
SERVER="https://jira.company.com"
user = "username"
password = "password"
jira = JIRA(SERVER, basic_auth=(user, password))https://stackoverflow.com/questions/60388895
复制相似问题