chaoss / grimoirelab-perceval

Send Sir Perceval on a quest to retrieve and gather data from software repositories.
http://perceval.readthedocs.io/
GNU General Public License v3.0
288 stars 176 forks source link

Jira Authentication Problem #752

Open isikozsoy opened 3 years ago

isikozsoy commented 3 years ago

Hello, I could not understand what should I use for user (Jira's attribute). I tried email and full-name. I could not find another option to use for user. Can anybody help me with this? Thanks for your time.

vchrombie commented 3 years ago

Hi @isikozsoy, thanks for opening the issue.

I think the user attribute is the username for the Jira instance.

Please let us know if that solves your doubt.

isikozsoy commented 3 years ago

Thanks for your response @vchrombie. However, I also checked if I can use username but I think username is not available in Jira. You can check it from the links.

https://confluence.atlassian.com/cloud/blog/2018/06/say-goodbye-to-usernames-in-atlassian-cloud https://community.atlassian.com/t5/Jira-questions/How-to-find-username-of-my-jira-account/qaq-p/969298

isikozsoy commented 3 years ago

Is it possible to modify the source code for Jira in a way that api token can be used for authorization like Github or GitLab? @vchrombie

https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/

vchrombie commented 3 years ago

Thanks for providing the info, @isikozsoy.

https://confluence.atlassian.com/cloud/blog/2018/06/say-goodbye-to-usernames-in-atlassian-cloud

Didn't know about this. Is this applicable only for the new versions?

Is it possible to modify the source code for Jira in a way that api token can be used for authorization like Github or GitLab? @vchrombie

It should be possible, but I'm wondering if it would break any existing systems. I would like to keep this issue open for more comments from the other community members.

Thanks for reporting the issue.

isikozsoy commented 3 years ago

Hello again @vchrombie, I figured out that we should use email for user and api token for password. Thanks for your time! I am closing the issue. Hope that it will help others as well.

vchrombie commented 3 years ago

@isikozsoy thanks a lot.

Do you think we can add something to make things clear? Would you be interested to open a PR for it?

isikozsoy commented 3 years ago

You're welcome @vchrombie.

We can use email instead of user and token instead of password in the soure code however this might break existing systems so I think it is better if we just modify the explanation for user and password parameters of Jira class by editing the comment. I can open a PR if you also agree with my suggestion.

vchrombie commented 3 years ago

Hello @isikozsoy, I have some more comments.

I figured out that we should use email for user and api token for password

Ok, does it work with email and password?

We can use email instead of user and token instead of password in the soure code however this might break existing systems

We need to check if we can use only the api_token for authentication. The current implementation uses basic_auth which has the username and password. If only token is sufficient then we can maybe change the implementation to use token_auth. https://github.com/chaoss/grimoirelab-perceval/blob/master/perceval/backends/core/jira.py#L437 https://github.com/chaoss/grimoirelab-perceval/blob/master/perceval/backend.py#L665 https://github.com/chaoss/grimoirelab-perceval/blob/master/perceval/backend.py#L715

If the only api_token method doesn't work, then we can think for email and api_token, maybe something similar to the zulip backend zulip/zulip.py#L230.

Please let me know if you are interested to give it a try. We can help you get started. We are now using Poetry for the project, please check installation - python-poetry.

$ git clone https://github.com/isikozsoy/grimoirelab-perceval
$ cd grimoirelab-perceval
$ poetry install
$ poetry shell
$ perceval jira --help

I think it is better if we just modify the explanation for user and password parameters of Jira class by editing the comment. I can open a PR if you also agree with my suggestion.

Yes, please. As a quick fix, it works and it makes sense. But, I would be interested to see if we can fix the backend too since the data source has changed from the initial version.

vchrombie commented 3 years ago

Opening the issue as we can open a PR and fix the problem.

xiao623 commented 2 years ago

Is there any new progress?

vchrombie commented 2 years ago

Is there any new progress?

I think @isikozsoy need some time to get her work completed on the PR.

zhifeiyue commented 11 months ago

Jira token based authentication resolved in issue #829

vchrombie commented 1 month ago

Jira token based authentication resolved in issue #829

I guess this issue can be closed then.