You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by hwaastad <he...@waastad.org> on 2014/03/13 11:42:48 UTC

tomee-emdedded,rest and jaas test

Hi,
I have a project using a custom jaas module an I'm protecting my rest
resources (and ejb's) via @rolesallowed and securityconstraints in web.xml
etc.
I't working as supposed to.

However,
is it possible to use tomee embedded for doing end-to-end testing?
i.e, catalina_opts (-Djava.security.auth.login.config) for tomee-embedded?
and login.config/context.xml

Or do I have to set system.setproperties in the test initializer?


br hw
 




--
View this message in context: http://openejb.979440.n4.nabble.com/tomee-emdedded-rest-and-jaas-test-tp4668182.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: tomee-emdedded,rest and jaas test

Posted by Romain Manni-Bucau <rm...@gmail.com>.
yeah, globally while you don't use jaas before  (JavaSE JAAS tests) it
works fine.
Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau



2014-03-13 12:49 GMT+01:00 hwaastad <he...@waastad.org>:
> OK,
> I made some tests....
> and adding login.config to src/test/resources
> and:
> System.setProperty("java.security.auth.login.config",
> "src/test/resources/login.config");
>
> and in webapp-root/META-INFO/context.xml adding jaasrealm info.
>
> Then I can do a complete end-to-end test including JAAS.
>
> ...learning by doing :-)
>
> br hw
>
>
>
> --
> View this message in context: http://openejb.979440.n4.nabble.com/tomee-emdedded-rest-and-jaas-test-tp4668182p4668185.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: tomee-emdedded,rest and jaas test

Posted by hwaastad <he...@waastad.org>.
OK,
I made some tests....
and adding login.config to src/test/resources
and:
System.setProperty("java.security.auth.login.config",
"src/test/resources/login.config");

and in webapp-root/META-INFO/context.xml adding jaasrealm info.

Then I can do a complete end-to-end test including JAAS.

...learning by doing :-)

br hw



--
View this message in context: http://openejb.979440.n4.nabble.com/tomee-emdedded-rest-and-jaas-test-tp4668182p4668185.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: tomee-emdedded,rest and jaas test

Posted by Romain Manni-Bucau <rm...@gmail.com>.
The property needs to be setup before any JAAS usage is done,
depending what you use of JAAS it can work if passed to tomee
properties.

The best way to validate you are in a good case or not is to test ;)
Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau



2014-03-13 11:42 GMT+01:00 hwaastad <he...@waastad.org>:
> Hi,
> I have a project using a custom jaas module an I'm protecting my rest
> resources (and ejb's) via @rolesallowed and securityconstraints in web.xml
> etc.
> I't working as supposed to.
>
> However,
> is it possible to use tomee embedded for doing end-to-end testing?
> i.e, catalina_opts (-Djava.security.auth.login.config) for tomee-embedded?
> and login.config/context.xml
>
> Or do I have to set system.setproperties in the test initializer?
>
>
> br hw
>
>
>
>
>
> --
> View this message in context: http://openejb.979440.n4.nabble.com/tomee-emdedded-rest-and-jaas-test-tp4668182.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.