Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Orion (Archived) » Need help writing Authentication Plugin
Need help writing Authentication Plugin [message #939426] Wed, 10 October 2012 18:53 Go to next message
Javier Pedemonte is currently offline Javier PedemonteFriend
Messages: 5
Registered: July 2009
Junior Member
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 21:32 Go to previous messageGo to next message
Mark Macdonald is currently offline Mark MacdonaldFriend
Messages: 35
Registered: July 2009
Member
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 21:37]

Report message to a moderator

Re: Need help writing Authentication Plugin [message #941542 is a reply to message #939546] Fri, 12 October 2012 16:19 Go to previous message
Javier Pedemonte is currently offline Javier PedemonteFriend
Messages: 5
Registered: July 2009
Junior Member
Excellent, that was it.

In my auth plugin, I setup a unique Jetty path to authenticationPlugin.html, then just replaced "plugins/authenticationPlugin.html". Now it's loading from the correct URL.

Thanks...
Previous Topic:Orion and same origin policy
Next Topic:Async highlighter
Goto Forum:
  


Current Time: Fri Dec 27 03:11:30 GMT 2024

Powered by FUDForum. Page generated in 0.02994 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top