无法使用Python中的API Auth Token连接到JIRA项目

尝试使用python代码连接到JIRA项目

express.static

我收到以下错误消息

r = requests.get('https://myproject.atlassian.net/rest/api/2/search?jql=project="myprojectid"',auth=('myuser@mydomain.com','Basic abcdefghijabcdefghij='))

print(r.headers)

当我使用相同的身份验证令牌卷曲时,我可以访问项目

{'Server': 'AtlassianProxy/1.15.8.1','WWW-Authenticate': 'OAuth realm="https%3A%2F%2Fmyproject.atlassian.net"','Cache-Control': 'no-cache,no-store,must-revalidate','Content-Type': 'text/html;charset=UTF-8','strict-transport-security': 'max-age=315360000; includeSubDomains; preload','Date': 'Fri,08 Nov 2019 07:59:26 GMT','ATL-TraceId': 'aaaaaaaaaaaa','X-AREQUESTID': '000000-0000-0000-0000-0000','Expires': 'Thu,01 Jan 1970 00:00:00 GMT','Pragma': 'no-cache','X-XSS-Protection': '1; mode=block','Transfer-Encoding': 'chunked','Timing-Allow-Origin': '*','X-Content-Type-Options': 'nosniff','Connection': 'keep-alive','X-Seraph-LoginReason': 'AUTHENTICATED_FAILED'}
lzhyq 回答:无法使用Python中的API Auth Token连接到JIRA项目

在您的脚本中,而不是像这样使用电子邮件地址和API令牌的base64

''' “基本abcdefghijabcdefghij =” '''

只需使用您的电子邮件地址和api令牌,上面的代码就是

''' r = request.get('https://myproject.atlassian.net/rest/api/2/search?jql=project=“ myprojectid”',auth =('myuser@mydomain.com','xyzzzzzzz'))

'''

本文链接:https://www.f2er.com/3139164.html

大家都在问