Skip to main content



      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 16:58 Go to next message
Eclipse UserFriend
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 02:23 Go to previous messageGo to next message
Eclipse UserFriend
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 14:01 Go to previous messageGo to next message
Eclipse UserFriend
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] Sun, 01 December 2013 19:44 Go to previous messageGo to next message
Eclipse UserFriend
@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] Sun, 01 December 2013 20:20 Go to previous messageGo to next message
Eclipse UserFriend
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 07:42 Go to previous messageGo to next message
Eclipse UserFriend
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 08:44 Go to previous messageGo to next message
Eclipse UserFriend
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] Mon, 02 December 2013 21:42 Go to previous messageGo to next message
Eclipse UserFriend
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 03:02 Go to previous messageGo to next message
Eclipse UserFriend
@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 03:26 Go to previous messageGo to next message
Eclipse UserFriend
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 05:11 Go to previous messageGo to next message
Eclipse UserFriend
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 05:37 Go to previous messageGo to next message
Eclipse UserFriend
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 09:35 Go to previous message
Eclipse UserFriend
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 22 16:47:19 EDT 2025

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

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

Back to the top