Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Login fails #7

Open
m1cl opened this issue Apr 30, 2019 · 7 comments
Open

Login fails #7

m1cl opened this issue Apr 30, 2019 · 7 comments

Comments

@m1cl
Copy link

m1cl commented Apr 30, 2019

I cannot login. It says my password is wrong. I tried it with my email, Full Name, Nick Name etc. Nothing worked. Is it possible to use a API token instead?

@suzil
Copy link

suzil commented Jul 25, 2019

I was trying for awhile today to make it work, but had problems with connecting. It looks like Jira is deprecating cookie-based authentication.

The deprecation period for this functionality has ended. From June 3rd, 2019, we will be progressively disabling the usage of this authentication method. If you are using a REST endpoint in Jira with basic authentication, update your app or integration to use API tokens, OAuth, or Atlassian Connect.

https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-basic-auth-and-cookie-based-auth/

Is the performance of basic auth with a token poor enough that this project would not work? Would oauth work better?

@nyyManni
Copy link
Owner

I would love to implement OAuth or token auth, but unfortunately our company is using JIRA Server instead of JIRA Cloud and it does not seem to support either of those (or I do not have enough access rights to enable them). Thus I do not have anything to test these login methods with, which makes them difficult to implement.

Atlassian completely deprecating cookie-based auth is unfortunate for Ejira.

They seems to offer a free evaluation for JIRA Cloud, but it is only 7 days, so it would make for a quite agile feaure release 😅

JIRA Server has a 30 day evaluation period. I could run it locally and check if I can get OAuth tokens working there, as I would be the admin. But that hard deadline might still be too much for my calendar.

@suzil
Copy link

suzil commented Jul 25, 2019

Aha yeah it looks like API tokens are a no-go for Jira Server.

Jira Server does not provide those specific types of API tokens that can be used in basic auth, like Jira Cloud does. If you want to create a token in Jira Server for use in REST calls, you need to create an OAuth token, which has an expectation of creating an application link as described in Jira Server Devleoper page on OAuth.

Maybe Ejira could be migrated to support both token-based and OAuth-based authentication? I have setup API tokens and it seems to work fine (maybe a bit slow to load issues but I'm already used to that when working with Jira).

I could make a PR to replace the current not-working (or does it work for you?), soon-to-be-deprecated cookie-based approach with the token approach. And then in a later PR I could try to setup OAuth?

@nyyManni
Copy link
Owner

The cookie-auth does work for me currently, I am using it on a daily basis.

If you could create a pull request with a working OAuth, it would be greatly appreciated. Even if you did one which replaces the cookie authentication with OAuth I could then stitch that code into ejira to work with both.

One thing that I would propose, though, is to make the pull request to https://github.com/nyyManni/jiralib2, as it was recently extracted away from Ejira. I will remove jiralib2.el from this repository in the "near future".

@nyyManni
Copy link
Owner

Repository at https://github.com/nyyManni/jiralib2 now updated with support for cookie, basic and token auth. Tested with a self-hosted JIRA Server and a JIRA Cloud trial. Would be nice if you could give it a try before my JIRA Cloud trial expires after 7 days 😄.

OAuth approach is a bit more involved, I might get into that #later.

@yqrashawn
Copy link

yqrashawn commented Sep 30, 2019

Just tested it. Login successfully to jira cloud with api token.
But get error when calling ejira-guess-epic-sprint-fields. We don't have any sprint on jira.

Attempting to auto-configure Ejira custom fields...
REQUEST [error] Error (error) while connecting to https://company.atlassian.net/rest/api/2/issue/nil/editmeta.
user-error: Request failed: Wrong URL path

@nyyManni
Copy link
Owner

nyyManni commented Sep 30, 2019

@yqrashawn

It seems that either of the queries in ejira-guess-epic-sprint-fields does not return any results.
The queries are:

  • "type = <ejira-epic-field>" for an epic (to get the epic summary field name)
  • "type != <ejira-epic-field>" for a regular issue (to get the epic link and sprint field names)

It is more likely that it is the first one which is failing. What is your setting of ejira-epic-type-name and does it correspond to the type name of an Epic on your JIRA?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants