I am trying to use oauth to access jira, and I am reading this document: Welcome to jira-python's documentation.

我正在尝试使用oauth访问jira,我正在阅读这个文档:欢迎来到jira-python的文档。

But in this oauth part, I cannot figure out how I can get these parameters:

但是在这个oauth部分,我不知道如何得到这些参数:

access_token, access_token_secret, consumer_key, key_cert

access_token、access_token_secret consumer_key key_cert

2 个解决方案

#1


11

I too am using jira-python. Since jira-python uses requests and requests-oauthlib I used those same libraries to implement the OAuth 1 dance necessary to get the tokens.

我也在使用jira-python。由于jira-python使用请求和请求-oauthlib,所以我使用了相同的库来实现获取令牌所需的OAuth 1舞蹈。

First, setup JIRA:

首先,设置JIRA:

  1. Generate RSA public/private key pair (you end up with rsa.pub and rsa.pem files). Your Python code will need access to the private key rsa.pem.
  2. 生成RSA公钥/私钥对(最终得到RSA)。酒吧和rsa。pem文件)。您的Python代码将需要访问私有密钥rsa.pem。
  3. Configure a JIRA application (done in JIRA admin under "Application Links") with "Incoming Authentication" and use the public key generated above. This is where you specify the consumer_key needed by jira-python
  4. 使用“传入身份验证”配置一个JIRA应用程序(在JIRA admin中完成),并使用上面生成的公钥。这是您指定jira-python所需要的consumer_key的地方。

Next, the OAuth dance. It's pretty simple with OAuth1Session from requests-oauthlib. Here is a simple example (CLI): JIRA Oauth in Python.

接下来,OAuth跳舞。请求-oauthlib的OAuth1Session非常简单。这里有一个简单的例子:Python中的JIRA Oauth。

The workflow is described in the requests-oauthlib docs: OAuth 1 Workflow.

工作流在request -oauthlib文档:OAuth 1工作流中描述。

So, to summarize:

所以,总结一下:

  • access_token - Obtained at the end of the OAuth 1 Workflow.
  • access_token—在OAuth 1工作流的末尾获得。
  • access_token_secret - Obtained at the end of the OAuth 1 Workflow.
  • access_token_secret——在OAuth 1工作流的末尾获得。
  • consumer_key - Specified when you setup an "Application Link" in JIRA admin.
  • 在JIRA admin中设置“应用程序链接”时指定了consumer_key。
  • key_cert - The contents of the rsa.pem file (private key). The public key is also added when setting up the "Application Link" in JIRA admin.
  • key_cert——rsa的内容。pem文件(私钥)。在JIRA admin中设置“应用程序链接”时也会添加公钥。

更多相关文章

  1. 用于在Google App Engine上构建应用程序的最佳开源IDE?
  2. 获取Android应用程序的Linux UID
  3. 在Linux中的脚本中安装应用程序
  4. 如何发送一个字节(或字节)来测试在我的应用程序中监听的套接字?
  5. 〖Linux〗使用Qt5.2.0开发Android的NDK应用程序
  6. 如何测试已部署的Web应用程序
  7. window下使用vnc远程登录linux图形界面和运行应用程序 和odroid
  8. [求助][CAB][安装包][CF2.0][SQL][setup]1000分请教:如何将CF2.0
  9. 为什么我们应该将XMPP而不是JSON用于简单(仅文本)消息传递应用程序

随机推荐

  1. 开发学习Jquery实例---双击表格弹出模态
  2. 使用jQuery的ASP.NET - POST vs GET
  3. Ajax php登录表单不指向另一个页面
  4. jQuery autocomplete:如何在结果中选择某
  5. 我通过jQuery-ajax创建了__PHP_Incomplet
  6. IE,jquery复选框不会改变
  7. jQuery使用注意点技巧2——jQuery 选择器
  8. 在体html中搜索文本的最佳方法是什么?
  9. jquery做的表格分页功能
  10. 笨鸟求问,下拉列表实现局部刷新的问题