In the case of Zend, this is done this way: Once you’ve got the config set up, you need to call the method to fetch the request token. Note: these keys must match the ones you set up in the “Application Link” The Zend OAuth uses these keys to sign the API calls it makes. RsaPrivateKey and rsaPublicKey hold the $private_key and $public_key classes respectively. SignatureMethod, in this case, tells the Zend OAuth class to use RSA signing instead of the Zend OAuth class default. This last part is common across all JIRA installs.ĬonsumerKey is the alphanumeric string you entered in the Consumer Key field during the setup of the “Application Link” in JIRA. Like the requestTokenUrl the URL begins with the host of the JIRA instance and then plugins/servlet/oauth/access-token. The last part is common across all JIRA installs.ĪccessTokenUrl is the URL that your system will call to convert the request token into an access token once the user has authorised access to their account. Like requestTokenUrl, the URL begins with the host of the JIRA instance and then plugins/servlet/oauth/authorize. The plugins/servlet/oauth/request-token is common to all JIRA instances.ĪuthorizeUrl is the URL that the user is sent to in order to authorise access to their account in a JIRA instance. This will be distinct for each JIRA instance. The URL begins with the JIRA instance host in this case represented by. RequestTokenUrl is the URL in the JIRA instance that is called to get the request token. The first element, callbackUrl, represents the URL in your system or application that JIRA will send the user back to during the authentication dance. The config object is then array of information and classes. Jira client tutorial code#This is done in the first two lines of code above. In the case of Zend Oauth classes it needs to convert the strings that are the public & private RSA keys into specific classes in order to be used. Getting the config right is important – otherwise you will spend a lot of time banging your head against a brick wall. $public_key = new Zend_Crypt_Rsa_Key_Public() $private_key = new Zend_Crypt_Rsa_Key_Private() Each call using OAuth needs to be signed by the RSA keys and you need to configure the call. The first method is to send a call to get the request token which you can then exchange for an access token. I’ll show you an outline that is based on using the Zend OAuth classes, but the basic principal should be the same with whatever OAuth library you use. The next step is to write the code to do the authentication of the user. You’ve now created an “Application Link” (consumer app) in the JIRA instance with which you can authenticate against. Enter Consumer Key (alphanumeric) and a Consumer Name, and paste the RSA public key into the “Public Key” field Check the checkbox for “Create incoming link”.ĥ. For the “Request Token URL”, “Access token URL” and the “Authorize URL”, enter. Repeat the name of the app, ProdPad, for the “Service Provider Name”, and enter prodpad for the “Consumer key” and the “Shared secret”. In the “Link Applications” modal window, enter the name of your app, ProdPad and select Generic Application from the “Application Type” dropdown. Enter into the field at the top of the “Configure Applications Link” page, and click Create new link. Log in to JIRA and, in the Administration list (click on the cog icon in the top right), head to Add-ons. To set up the consumer app, do the following (Note: You will need to have administrator access to your JIRA account):ġa. Before you can authenticate or communicate with a JIRA instance, you need to set up this “Application Link” and the RSA keys to be used for signing. JIRA calls the OAuth consumer app “Application Link”, which requires RSA keys for signing the API calls. Note: each JIRA instance that you are connecting to will need a consumer app to be set up, whether that JIRA instance is hosted or standalone. JIRA uses RSA encryption as part of its OAuth setup.īefore you can do the authentication, you have to set up a consumer app in the JIRA install. There is no central repository of consumer applications (unlike say Twitter or Trello), andī. The key to understanding JIRA OAuth setup is that:Ī. If you’re looking to build your own JIRA integration, we hope this helps! Understanding JIRA OAuth This tutorial applies to both the hosted “OnDemand” version and standalone installations. Instead of keeping this to ourselves, I’ve decided to write a little tutorial to help others trying to setup JIRA OAuth. Jira client tutorial trial#It was a process of trial and error (and finally stumbling across this helpful page) that helped me get the OAuth integration for JIRA up and working. In the process of building this, I found the documentation for authentication in JIRA to be… let’s say lacking. This allows you to push ideas and user stories across to JIRA, creating a link back and forth between the two apps. As we announced recently, we’ve integrated ProdPad with JIRA.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |