nyyManni / ejira

Emacs JIRA integration
GNU General Public License v3.0
255 stars 36 forks source link

403 browser login works. (SAML) yet jiralib1 works with just simple auth #4

Open snuffop opened 5 years ago

snuffop commented 5 years ago

I'm sure this has something to do with the method in which I'm accessing our Jira. Simple auth works with jiralib.el (org-jira) yet it cannot pull the (way to many) issues from the system before timeout. I'm hoping your jiralib2 can handle the job yet I can't seem to get past this 403 error. I'm not sure what else to try. It is a corp handled jira so modification would take an act of this hate trump Congress.

nyyManni commented 5 years ago

Since the browser is using cookie-based authentication as well, it should be possible to get jiralib2 working, too.

If you have too many failed login attempts through the API, Jira might need you to log in from the browser and fill a captcha. I have had to do that several times.

The minimal steps to get the login to work are:

(setq jiralib2-url "https://jira.mycorp.com")  ;; note, no /rest/api/2 here, make sure you use correct protocol http/https
(jiralib2-session-login "username" "password")  ;; Evaluating this should return a string "JSESSIONID=...", it is also bound to *JIRA-SESSION*
snuffop commented 1 year ago

I've attempted to try ejira again. apparently your lib is hitting the saml auth due to not appending the /rest/api/2 portion to the calls. prompting in emacs to login in the browser

Eval of (jiralib2-session-login "username" "password") with username and password replaced with proper values
login denied login in the browser.

SAML frontend denied. each time as the saml login is also 2fa.

I am connected and using the hosted jira perfectly in the browser. I don't understand what hook or method emacs uses the browser to get a session id? I've even attemted to set the JIRASESSION to the cookie found in the browsers session..

login denied login in the browser

Org-jira connects and pulls the data (partially) but it seems that the calls to the hosted version api's are different enough from the cloud version that it breaks on update and insert. So I tried ejira again.

jiralib2-verify-setup reports successfully logged in.