Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » e(fx)clipse » Using RBAC Pattern with e(fx)clipse(Security Framework for e(fx)clipse)
Using RBAC Pattern with e(fx)clipse [message #1173986] Wed, 06 November 2013 21:58 Go to next message
Ghislain Mustermann is currently offline Ghislain MustermannFriend
Messages: 24
Registered: April 2013
Junior Member
Now where i create a dummy login mechanism. As a newbie i want to go further and embrassed the RBAC Pattern. I know several Framework (Spring Security, Shiro), is there any reason to dont use this one with e(fx)clipse?

Can i use for example Shiro as my security framework with e(fx)clipse without breaking something or is into e(fx)clipse already some mechanism to rules Users?
Re: Using RBAC Pattern with e(fx)clipse [message #1174579 is a reply to message #1173986] Thu, 07 November 2013 07:23 Go to previous messageGo to next message
Uwe San is currently offline Uwe SanFriend
Messages: 119
Registered: January 2012
Senior Member
I think you could use Shiro without any problems since e(fx)clipse is not concerned with security. It should work with any security framework.
Re: Using RBAC Pattern with e(fx)clipse [message #1178569 is a reply to message #1173986] Sat, 09 November 2013 19:01 Go to previous messageGo to next message
Dennis Lee is currently offline Dennis LeeFriend
Messages: 32
Registered: September 2013
Member
I'm using Shrio and don't have any problem so far.
Re: Using RBAC Pattern with e(fx)clipse [message #1219106 is a reply to message #1173986] Mon, 02 December 2013 00:44 Go to previous messageGo to next message
Ghislain Mustermann is currently offline Ghislain MustermannFriend
Messages: 24
Registered: April 2013
Junior Member
@Uwe San, @Dennis Lee

Well im trying to get a Resource Path into my Bundle but i cant.

I create a folder "resources" on the same level like the "META-INF" Folder, inside "resources" i create the shiro.ini file. Now i done this into my Bundle :

	
public void start(BundleContext context) throws Exception {
		UserSecurityActivator.context = context;

		// 1. Load the INI configuration
		URL path = context.getBundle().getResource("shiro.ini");

		Ini shiroIni = Ini.fromResourcePath(path.getPath());

		Factory<SecurityManager> factory = new IniSecurityManagerFactory(
				shiroIni);



But i get a File not Found Exception. Because "fromResourcePath" dont find the file but the URL path exists.

"classpath:shiro.ini" dont return the expected file too!!

How do you find the right path (classpath) of a resources in a Bundle?
Re: Using RBAC Pattern with e(fx)clipse [message #1219108 is a reply to message #1219106] Mon, 02 December 2013 01:20 Go to previous messageGo to next message
Ghislain Mustermann is currently offline Ghislain MustermannFriend
Messages: 24
Registered: April 2013
Junior Member
i see this stackoverflow : http://stackoverflow.com/questions/15912429/where-should-shiro-ini-go-in-a-web-application . How to translate it into e(fx)clipse environment?
Re: Using RBAC Pattern with e(fx)clipse [message #1219160 is a reply to message #1219106] Mon, 02 December 2013 12:42 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
On 02.12.13 01:44, Ghislain Mustermann wrote:
> @Uwe San, @Dennis Lee
>
> Well im trying to get a Resource Path into my Bundle but i cant.
>
> I create a folder "resources" on the same level like the "META-INF"
> Folder, inside "resources" i create the shiro.ini file. Now i done this
> into my Bundle :
>
> public void start(BundleContext context) throws Exception {
> UserSecurityActivator.context = context;
>
> // 1. Load the INI configuration
> URL path = context.getBundle().getResource("shiro.ini");
>
> Ini shiroIni = Ini.fromResourcePath(path.getPath());
>
> Factory<SecurityManager> factory = new IniSecurityManagerFactory(
> shiroIni);
>
>
>
> But i get a File not Found Exception. Because "fromResourcePath" dont
> find the file but the URL path exists.
> "classpath:shiro.ini" dont return the expected file too!!
>
> How do you find the right path (classpath) of a resources in a Bundle?
>

Well shouldn't the path be
context.getBundle().getResource("resources/shiro.ini");
Re: Using RBAC Pattern with e(fx)clipse [message #1219178 is a reply to message #1173986] Mon, 02 December 2013 13:44 Go to previous messageGo to next message
Ghislain Mustermann is currently offline Ghislain MustermannFriend
Messages: 24
Registered: April 2013
Junior Member
Hi Thomas,

that one work too... but IniSecurityManagerFactory dont recognize it. It's strange!! like IniSecurityManagerFactory is not able to understand path into an Osgi environment.
Re: Using RBAC Pattern with e(fx)clipse [message #1219264 is a reply to message #1219106] Tue, 03 December 2013 02:42 Go to previous messageGo to next message
Dennis Lee is currently offline Dennis LeeFriend
Messages: 32
Registered: September 2013
Member
My code is:

Factory<SecurityManager> factory = new IniSecurityManagerFactory("classpath:conf/shiro.ini");


My shiro.ini is in conf directory which is located in root of source. So your case, I think, it should be "classpath:resources/shiro.ini".
Re: Using RBAC Pattern with e(fx)clipse [message #1219289 is a reply to message #1219264] Tue, 03 December 2013 08:02 Go to previous messageGo to next message
Ghislain Mustermann is currently offline Ghislain MustermannFriend
Messages: 24
Registered: April 2013
Junior Member
@Dennis, @Thomas

Thank you guyz for your tipps!! Shiro has more than one keys for IniSecurityManagerFactory : classpath, url, file.

I use
Url path = context.getBundle().getResource("resources/shiro.ini");
to get the Path and then
Factory<SecurityManager> factory = new IniSecurityManagerFactory("url:" + path);


So now its work.... but another problem. It seems so Shiro needs org.apache.commons.beansutils. I added the maven dependency into my Bundle POM and add the jar into Eclipse Repository/plugins Folder. But i cant add commons.beansutils as dependency into my Manifest.

How can i make commons.beansutils available as dependency in an e(fx)clipse Bundle??
Re: Using RBAC Pattern with e(fx)clipse [message #1219296 is a reply to message #1219289] Tue, 03 December 2013 08:26 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
what "Eclipse Repository/plugins" are you talking about, you can't
simply drop something in a p2 repo!

You'd better create an additional folder and put the plugin there.

Tom

On 03.12.13 09:02, Ghislain Mustermann wrote:
> @Dennis, @Thomas
>
> Thank you guyz for your tipps!! Shiro has more than one keys for
> IniSecurityManagerFactory : classpath, url, file.
> I use Url path = context.getBundle().getResource("resources/shiro.ini");
> to get the Path and then Factory<SecurityManager> factory = new
> IniSecurityManagerFactory("url:" + path);
>
> So now its work.... but another problem. It seems so Shiro needs
> org.apache.commons.beansutils. I added the maven dependency into my
> Bundle POM and add the jar into Eclipse Repository/plugins Folder. But i
> cant add commons.beansutils as dependency into my Manifest.
> How can i make commons.beansutils available as dependency in an
> e(fx)clipse Bundle??
Re: Using RBAC Pattern with e(fx)clipse [message #1219317 is a reply to message #1219296] Tue, 03 December 2013 10:11 Go to previous messageGo to next message
Ghislain Mustermann is currently offline Ghislain MustermannFriend
Messages: 24
Registered: April 2013
Junior Member
Sorry my Bad; with Eclipse Repository/plugins i meant Eclipse Installation Folder -> plugins Folder. I added for example shiro jars in that way, when i restart eclipse i can then add it as dependency in my Manifest. But this way dont work with the commons.beansutils jar .
Re: Using RBAC Pattern with e(fx)clipse [message #1219322 is a reply to message #1219317] Tue, 03 December 2013 10:37 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
So your target-definition is a mixture of the IDE & e(fx)clipse update-site.

This is good way to screw things up and make stuff break unpredictable
ways. I'd highly advice you to not do this.

a) learn about p2 repositories (use the one from efxclipse) and how to
create your own ones
b) learn about orbit use it in your target platform

If you follow a & b you won't run into problems when running inside the
IDE and on your CI-Server (e.g. using maven-tycho)

Tom

On 03.12.13 11:11, Ghislain Mustermann wrote:
> Sorry my Bad; with Eclipse Repository/plugins i meant Eclipse
> Installation Folder -> plugins Folder. I added for example shiro jars in
> that way, when i restart eclipse i can then add it as dependency in my
> Manifest. But this way dont work with the
> http://mvnrepository.com/artifact/commons-beanutils/commons-beanutils/1.8.3
> jar .
Re: Using RBAC Pattern with e(fx)clipse [message #1219364 is a reply to message #1219322] Tue, 03 December 2013 14:35 Go to previous message
Ghislain Mustermann is currently offline Ghislain MustermannFriend
Messages: 24
Registered: April 2013
Junior Member
Okay thank you! i take notes!!
Previous Topic:Right way to use the embedded Guava Library?
Next Topic:How to set icon in a dialog extension
Goto Forum:
  


Current Time: Tue Apr 23 11:13:21 GMT 2024

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

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

Back to the top