gioboa / jira-plugin

Jira plugin for VsCode
https://marketplace.visualstudio.com/items?itemName=gioboa.jira-plugin
MIT License
266 stars 41 forks source link

Support for API key authentication #12

Closed kahyoung-zz closed 6 years ago

kahyoung-zz commented 6 years ago

👋 This extension looks great but I can't use it at my workplace. We authenticate using Google OAuth, so we don't really have an email and password to attach.

Would love to be able to use API keys though.

I can have a look at this later on and see if I can make a PR.

gioboa commented 6 years ago

Hi, I will check if there is the possibility to login with Google 0Auth. For sure if you find something create a pull request. :wink:

gioboa commented 6 years ago

I created a new branch "jira-connector", it's for remove custom Jira calls and use "jira-connector" npm. With this package we have Base and OAuth Authentication. :+1:

gioboa commented 6 years ago

In this branch I replace custom API Calls with jira-connection. In this commit I add some code for OAuth code. @kahyoung I need your help to verify if like this can work. 👍

kahyoung-zz commented 6 years ago

@gioboa Sorry about the delay, will verify this later today 👍 thanks heaps for getting on this though!

gioboa commented 6 years ago

Now master branch use jira-connection lib. v. 0.7.0
@kahyoung Did you try with OAuth Authentication?

blueo commented 6 years ago

FWIW I just tried logging in with a google account - and no joy. It looks as though i'd need to add consumer keys etc?

gioboa commented 6 years ago

@blueo Yes, you understand the problem.
I don't have the possibility to try with OAuth Authentication. In src/http/api.ts there is the connection method.
Can you help me to implement OAuth Authentication connection?
You can follow CONTRIBUTING.md doc and create a PR. 👍
Let me know. Thanks. 😄

NKjoep commented 5 years ago

Hello,

I came here for the same reason, I'd like to connect to Jira with a user token.

Reading the jira-connect documentation, it looks like it's just not supported.

However, according on the Atlassian documentation, the user token can be used as a password for basic auth :)

And the example is pretty straighforward and works indeed:

curl -v https://company.atlassian.net --user your@email.com:token

Then I have question: why doesn't this work with jira-connect (and so with this beautiful vscode pluing)? What am I missing?

gioboa commented 5 years ago

Hi, so even if you put your email in user and the token inside the password the authentication went wrong?

NKjoep commented 5 years ago

~Yes, it went wrong and I get the long log in the vscode extentension output panel.~

edit: as I said earlier, my token is valid. I've tested it with curl and postman.

edit 2: I think I've found out why it wasn't working: I had multiple instanced of vscode and the settings weren't update accordingly. It Works!

gioboa commented 5 years ago

So if we insert in user the email and inside password the token, will it work correctly?

NKjoep commented 5 years ago

Correct!

It worked like this for me:

  1. go to https://id.atlassian.com/manage/api-tokens and create a token
  2. close all the vscode
  3. open one vscode instance
  4. setup the jira-plugin with: 3.a url: your base atlassian url (https please!) 3.b username: your full email 3.c passowrd: the token
blueo commented 5 years ago

so this worked for me too, thank you for the instructions!