Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 349395

Summary: Plugins give no feedback when authentication is required
Product: [ECD] Orion Reporter: John J. Barton <johnjbarton>
Component: ClientAssignee: Simon Kaegi <simon_kaegi>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: ken_walker, malgorzata.tomczyk, simon_kaegi, Szymon.Brandys
Version: 0.2Flags: john.arthorne: review+
Target Milestone: 1.0 RC2   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Bug Depends on:    
Bug Blocks: 349443, 350329    

Description John J. Barton CLA 2011-06-15 00:16:45 EDT
I've had my plugin go missing from the installed list many times now and I think I've found the scenario.

I'm using 
https://fbug.googlecode.com/svn/extensions/dyne/branches/dyne0.1
linked to |dyne| in orion. I don't think this matters, but...

Start with a file to edit
 http://localhost:8080/edit/edit.html#/file/c/doc/dynedoc.css
and a user-defined plugin installed. I don't know if it matters but my plugin is self hosted:
http://localhost:8080/file/c/content/orionPlugin/firebugConnection.html

Save the URL for the file to edit.
Logout of Orion.
Open the edit URL.  The page loads but the plugins do not. 
Edit the file and Save. 
You get a login dialog: log in.
Your edits are saved, but the plugin has vanished.
Comment 1 John J. Barton CLA 2011-06-15 00:33:18 EDT
Well it seems like the logon has to expire. I can't reproduce it by logging out.
Comment 2 Simon Kaegi CLA 2011-06-15 09:43:46 EDT
It sounds to me like your plugin is being protected by the workspace authentication filter. If that's true then I bet you're getting a 401 in your plugin and we're not being good about handling it.

The authentication story for plugins is not at all where we want it and at the moment either piggybacking on existing authentication tokens or else only works with anonymous. If your session timed out then that indeed would hose you.
Comment 3 Simon Kaegi CLA 2012-08-30 20:12:01 EDT
I going to use this bug to track ensuring I add the login bits to our soon to be done notification area.
Comment 4 Szymon Brandys CLA 2012-10-12 10:27:40 EDT
(In reply to comment #3)
> I going to use this bug to track ensuring I add the login bits to our soon
> to be done notification area.

The recent changes removed handling 401 when xhr calls are made from the page and the session expired. I don't understand why you are removing this code?
Comment 5 Simon Kaegi CLA 2012-10-12 11:31:25 EDT
Hi Szymon
We're mid-stream in the change -- I'm adding it back now but differently and at a lower layer. The UI is different and rather than using the login dialog we're using the status service notification and a "login" link that the plugin provides in its manifest.

auth.js has been broken for essentially the entire release as it was involved in a dependency cycle so we were hitting a TypeError rather than letting the error bubble up. No-one really noticed because the bootstrap always redirects to the login page if not logged in. auth.js and logindialog were referenced in roughly 10 files so we decided to remove the references as a first step to help ensure our merge on commit would be simple for a reviewer to look at.

More coming shortly...
Comment 6 Simon Kaegi CLA 2012-10-12 17:21:41 EDT
John reviewed.
Its not a beautiful UX which we'll work on in rc3 but its checked in -- also includes cross orion filesystem support so you can mount your local orions filesystem in orion.eclipse.org.
Comment 7 Simon Kaegi CLA 2012-10-15 09:54:58 EDT
Ken reviewed.
I did one final fix to ensure the login window opens in a _blank target and handled an error check better that masking some problem reporting.