Need help writing Authentication Plugin [message #939426] |
Wed, 10 October 2012 14:53  |
Eclipse User |
|
|
|
I'm working on an authentication plugin for Orion v0.5 (cannot move up to 1.0 yet).
I copied org.eclipse.orion.server.authentication.formopenid and replaced the bits I needed for my authentication service. I even changed the URL in authenticationPlugin.html from "mixloginstatic/LoginWindow.html?redirect=XXX?key=FORMOpenIdUser" to something like "mylogin/LoginWindow.html?redirect=XXX?key=MyUser".
Then I ran Orion from within Eclipse with the following setup:
* In web-ide.conf, I added "orion.auth.name=MyAuth" (corresponds to the name in my plugin's OSGI-INF/component.xml).
* I disabled the org.eclipse.orion.server.authentication.feature from the Eclipse run configuration, and enabled my plugin.
Now, when loading localhost:8080, I would expect it to load the "/mylogin/..." URL. Instead, it still goes to "/mixloginstatic/..." -- even though the Orion auth plugins have been disabled.
This seems to be due to the authenticationPlugin.* files in the org.eclipse.orion.client.core plugin. It is setting the URL to "/mixloginstatic/...".
How can I make it so the authenticationPlugin.html from my plugin is used, rather than the one from org.eclipse.orion.client.core?
|
|
|
Re: Need help writing Authentication Plugin [message #939546 is a reply to message #939426] |
Wed, 10 October 2012 17:32   |
Eclipse User |
|
|
|
Look for a file named defaults.pref located in the org.eclipse.orion.client.core bundle. Open that file, find this line:
"plugins/authenticationPlugin.html": true,
The string in quotation marks is a URL. Change it to reference your new authentication plugin. The next time you load Orion (note: you may need to clear your browser's cache and localStorage database first), your own auth plugin will be loaded instead of Orion's default authenticationPlugin.html.
The longer explanation is that, in the Orion client, authentication is provided by Orion Plugins. These are different from Eclipse plug-ins: they can live anywhere on the web, and don't need to run in an Eclipse/OSGi environment. The defaults.pref file specifies the list of Orion Plugins that are installed by default in your Orion client, similar to how the Run Configurations dialog specifies which Eclipse plug-ins are active in an Eclipse launch.
To customize which plugins are active, we just edit defaults.pref and boot out stuff we don't want. An individual user can also control their own plugin environment by going to User Menu > Settings > Plugins after logging into Orion.
[Updated on: Wed, 10 October 2012 17:37] by Moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.05227 seconds