grimoirelab-perceval icon indicating copy to clipboard operation
grimoirelab-perceval copied to clipboard

Jira Authentication Problem

Open isikozsoy opened this issue 4 years ago • 13 comments

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.

isikozsoy avatar Aug 24 '21 09:08 isikozsoy

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.

vchrombie avatar Aug 24 '21 11:08 vchrombie

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 avatar Aug 24 '21 11:08 isikozsoy

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/

isikozsoy avatar Aug 24 '21 11:08 isikozsoy

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.

vchrombie avatar Aug 24 '21 17:08 vchrombie

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.

isikozsoy avatar Aug 27 '21 09:08 isikozsoy

@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?

vchrombie avatar Aug 28 '21 11:08 vchrombie

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.

isikozsoy avatar Aug 28 '21 12:08 isikozsoy

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 avatar Aug 28 '21 18:08 vchrombie

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

vchrombie avatar Aug 28 '21 18:08 vchrombie

Is there any new progress?

xiao623 avatar Sep 29 '21 03:09 xiao623

Is there any new progress?

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

vchrombie avatar Sep 29 '21 07:09 vchrombie

Jira token based authentication resolved in issue #829

zhifeiyue avatar Oct 20 '23 03:10 zhifeiyue