Bug 163120 - [e3.5] set authentication credentials when opening a task with the embedded browser
Summary: [e3.5] set authentication credentials when opening a task with the embedded b...
Status: CLOSED MOVED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P2 enhancement with 3 votes (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: plan
: 171764 173842 184402 202753 269541 (view as bug list)
Depends on: 187315 238277
Blocks: 343600
  Show dependency tree
 
Reported: 2006-11-01 14:31 EST by Robert Elves CLA
Modified: 2011-06-15 05:42 EDT (History)
12 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Elves CLA 2006-11-01 14:31:26 EST
Browser authentication needs to be handled (invisibly). Currently if a site is protected with http authentication the UpdateManagerAuthenticator is used to retrieve http auth credentials (which we already have in the task repository settings page).  If the bugzilla instance requires logon the browser will present a bugzilla authentication page (but we are already authenticated via BugzillaClient).  For http auth perhaps we can set the necessary connection parameters on the connection used by the browser widget?  For bugzilla maybe we could pass the authentication cookies we already have from BugzillaClient on to the browser widget?
Comment 1 Steffen Pingel CLA 2007-01-26 12:26:12 EST
*** Bug 171764 has been marked as a duplicate of this bug. ***
Comment 2 Eugene Kuleshov CLA 2007-02-26 12:54:55 EST
I have some ideas how this can be implemented. If someone want to investigate this, please contact me.
Comment 3 Steffen Pingel CLA 2007-03-14 13:52:00 EDT
*** Bug 173842 has been marked as a duplicate of this bug. ***
Comment 4 Eugene Kuleshov CLA 2007-04-27 12:20:53 EDT
*** Bug 184402 has been marked as a duplicate of this bug. ***
Comment 5 Andreas Goetz CLA 2007-04-28 06:18:12 EDT
In bug 184402 I was wondering if this could be done non-explicitly. What I mean is that just the session (cookie) information of the browser widget might be captured  on close and later restored when issue from same repository is opened. So not explicitly setting any credentials in username/password form, rather just keep cookie session alive?
Comment 6 Eugene Kuleshov CLA 2007-04-28 09:48:57 EDT
Same story. As far as I know, browser widget don't have an api to set anything like that.
Comment 7 Andreas Goetz CLA 2007-05-16 08:44:36 EDT
Shouldn't the issue be reassigned from Mylar to platform/ browser widget owners? Would really like to see this- otherwise web connector usage is kind of tedious..

Thanks,
Andi
Comment 8 Mik Kersten CLA 2007-05-16 11:49:03 EDT
Good point.  Please do feel free to file a new bug against Platform on this and make this one depend on it. 
Comment 9 Andreas Goetz CLA 2007-05-16 12:48:06 EDT
Will do. Did a little checking first. Even if hacky- would this help?
http://www.sagewire.org/swt-platform-eclipse/Browserexecute-failure-306849.aspx
Comment 10 Andreas Goetz CLA 2007-05-16 13:02:27 EDT
execute() doesn't return data... Opened bug 187315- please update depends on field. Thanks.
Comment 11 Mik Kersten CLA 2007-05-16 13:28:00 EDT
Thanks Andreas.  We have to leave this as helpwanted for 2.0, but may be able to look at a patch.  I've seen this approach used before and we would also have to make sure that it is robust across platforms because I think I recall seeing it fail with Safari as the embedded browser.
Comment 12 Eugene Kuleshov CLA 2007-05-17 21:50:07 EDT
From bug 187315

1) open browser at web repository url; use addProgressListener(ProgressListener) to get notified about load finished. Widget might be invisble at that time
2) use execute() to set the cookies using javascript setCookie(), check http://techpatterns.com/downloads/javascript_cookies.php
3) repeat step 1), widget is visible now
4) user does whatever- we'll need to listen for widget destruction or navigation events through ProgressListener
5) if widget is closed or navigated, we use execute() again to get the current cookies and associate them with the repository
Comment 13 Andreas Goetz CLA 2007-05-19 02:55:06 EDT
From bug 187315

Btw this is not only needed for web connector, but for all connectors- e.g. bugzilla when voting.
Comment 14 Andreas Goetz CLA 2007-06-11 05:09:02 EDT
Mik, regarding comment 11, could you point me to where you've seen this before? Better use best practice than reinvent the wheel..
Comment 15 Mik Kersten CLA 2007-06-11 18:34:21 EDT
I was referring to what Grant Gayed linked in comment#1 of bug 187315.
Comment 16 Eugene Kuleshov CLA 2007-09-10 16:16:36 EDT
*** Bug 202753 has been marked as a duplicate of this bug. ***
Comment 17 Mik Kersten CLA 2007-09-10 22:59:38 EDT
Eugene: this is not a good candidate for bugday because the solution for this likely needs to be browser or OS specific, and as such is out of the current scope of Mylyn.  However, leaving open and helpwanted in case SWT enables a more generic solution.
Comment 18 Eugene Kuleshov CLA 2007-09-10 23:06:31 EDT
(In reply to comment #17)
> Eugene: this is not a good candidate for bugday because the solution for this
> likely needs to be browser or OS specific, and as such is out of the current
> scope of Mylyn.  However, leaving open and helpwanted in case SWT enables a
> more generic solution.

Solution suggested by SWT guys that is outlined in comment #12 doesn't seem like browser or OS specific.
Comment 19 Mik Kersten CLA 2007-09-11 00:39:32 EDT
(In reply to comment #18)
> Solution suggested by SWT guys that is outlined in comment #12 doesn't seem like
> browser or OS specific.

Shawn: do you know if that approach works across browsers, or does that style of Javascript invocation typically require MSIE/Mozilla specific coding and Browser access?
Comment 20 Shawn Minto CLA 2007-09-11 11:36:34 EDT
That approach should work across browsers, but there are some incompatibilities with JS on MAC and Linux, so some more testing would be needed to ensure that this method would work.
Comment 21 Andreas Goetz CLA 2008-03-18 10:48:11 EDT
Any chance revisting this for next release? Only thing preventing me from using Mylyn for sf.net and others...
Comment 22 Ketan Padegaonkar CLA 2008-03-24 21:27:40 EDT
I've filed a request for an alternate approach to this on bug 223760.
Comment 23 Mik Kersten CLA 2008-04-08 19:25:16 EDT
Andreas: our current focus is the Tasks framework and support rich connectors and as Ketan points out this improvement would be best made to the SWT browser widget.
Comment 24 Andreas Goetz CLA 2009-06-15 03:53:21 EDT
Ketan, seeing that bug 223760 has been resolved- have you by chance been able to try this approach? If not I'd volunteer to test with SF as sample app.
Comment 25 Mik Kersten CLA 2009-06-17 17:54:40 EDT
Raising priority.  It would be nice to have this in order to avoid the need to log in.
Comment 26 Andreas Goetz CLA 2009-06-19 12:11:36 EDT
I've spent some time looking into this and believe there might at least two more or less complex scenarios at hand:
1) The repository supports some form of authentication like BASIC or similar. I'm not sure this is already handled by the code, but in this scenario the OpenWithBrowserAction and openUrl methods would need to be enhanced to a) retrieve the credentials from the repository and b) add an authentication listener to the browser
2) Most web sites will set cookies to recognize returning users. This could easily be supported by the new set/getCookie API in swt.browser. The cookie (or rather- all cookies) should be stored as repository parameters (there is such a thing, is there?) and initially set when opening the browser and retrieved each time browser navigation is finished using a progresslistener.
In each case, I'm stuck at the point where I need to obtain an swt.browser, as the WorkbenchUtil only provides IWorkbenchBrowserSupport. Is there any chance to get one from the other?
Comment 27 Mik Kersten CLA 2009-08-13 17:20:37 EDT
Rob, Steffen: How hard is this?  I wonder if we should consider it for 3.3.
Comment 28 Steffen Pingel CLA 2009-08-13 17:32:53 EDT
This would require some work for Trac and JIRA since we currently don't provide access to the login cookie. By default Trac doesn't need one since it authenticates for each request so it would have to explicitly login before opening the browser. JIRA logs out after each request invalidating the cookie (bug 277405).
Comment 29 Steffen Pingel CLA 2009-08-17 03:05:25 EDT
*** Bug 269541 has been marked as a duplicate of this bug. ***
Comment 30 Mik Kersten CLA 2010-04-15 13:49:38 EDT
As per today's discussion, this will be a bit tricky due to needing to maintaining 3.4 support so it will require an up-front design discussion, but it would be very valuable to have.
Comment 31 Evgeny Avtsin CLA 2010-08-31 09:49:29 EDT
Is there a timetable for fixing this bug?
This is a serious usability issue...
Comment 32 Mik Kersten CLA 2011-02-02 12:16:50 EST
This is indeed annoying and is a great candidate for community contribution.  I'm tentatively going to put it on the 3.5 plan but it may only get done if someone out there is feeling motivated.
Comment 33 Werner Keil CLA 2011-02-02 13:19:29 EST
Which browsers and versions does this apply to?
Comment 34 Mik Kersten CLA 2011-02-03 03:09:51 EST
The embedded browser, ie, as of Eclipse 3.5 you should be able to set the credentials directly on SWT's Browser widget.  If I recally correctly.  Steffen?  Shawn?
Comment 35 Evgeny Avtsin CLA 2011-02-03 09:03:52 EST
The issue in reproducible in 3.6.2 and 3.7.0: the credentials are requested to be entered/confirmed in Internal Browser's sub-window. 
I expect that the setting repository credentials will be used for connecting URL without any additional UI.
Comment 36 Evgeny Avtsin CLA 2011-02-03 09:07:21 EST
Sorry, I meant 3.5.2 and 3.6.0
Comment 37 Shawn Minto CLA 2011-02-04 14:28:44 EST
I am pretty sure that the API was added in 3.5.0 (Both for cookies and authentication).  Since we still support 3.4.x, this will make it a bit more difficult, but should be doable.
Comment 38 Steffen Pingel CLA 2011-02-04 16:52:41 EST
We don't officially support Eclipse 3.4 any longer. The summary of this bug indicates that the API was added in Eclipse 3.5 so it should be feasible to implement this now.
Comment 39 Mik Kersten CLA 2011-02-15 14:19:43 EST
Steffen: Let's consider this for 3.6.  Tentatively adding to plan.
Comment 40 Evgeny Avtsin CLA 2011-06-13 10:59:02 EDT
I cancel my vote - the credentials can be passed via overriding AbstractRepositoryConnector#getAuthenticatedUrl() or calling addAuthenticationListener() of SWT Browser.
Comment 41 Robert Munteanu CLA 2011-06-14 16:20:31 EDT
(In reply to comment #40)
> I cancel my vote - the credentials can be passed via overriding
> AbstractRepositoryConnector#getAuthenticatedUrl() or calling
> addAuthenticationListener() of SWT Browser.

Well, the first one is a valid workaround for connectors which implement a url-based authentication scheme, which is not always true.

As for the Browser-based workaround, where in the Mylyn API have you find a way to access the underlying browser widget?
Comment 42 Evgeny Avtsin CLA 2011-06-15 05:42:23 EDT
(In reply to comment #41)

> Well, the first one is a valid workaround for connectors which implement a
> url-based authentication scheme, which is not always true.
> 
> As for the Browser-based workaround, where in the Mylyn API have you find a way
> to access the underlying browser widget?

I use an url-based authentication scheme in the mainstream.
Browser-based workaround requires replacing the Mylyn command action, actually it means eliminating use of Mylyn API for opening the task in browser.
Comment 43 Eclipse Webmaster CLA 2022-11-15 11:45:08 EST
Mylyn has been restructured, and our issue tracking has moved to GitHub [1].

We are closing ~14K Bugzilla issues to give the new team a fresh start. If you feel that this issue is still relevant, please create a new one on GitHub.

[1] https://github.com/orgs/eclipse-mylyn