You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@karaf.apache.org by Charles Moulliard <ch...@gmail.com> on 2013/01/12 11:03:08 UTC

Any idea to design a JUnit test for Security/Realm

Hi,

As we have Camel/Karaf projects using JAAS & Realm but until now no unit
test allowing to authenticate a user/password & Role against realm deploy
in Karaf or in any other Java container (EE, Standalone, Jetty, Tomcat), I
try to figure out How we could create a class to register realms (during
@Before phase of JUnit) and that next we could use in a test with cxf,
camel-cxf, osgi service to intercept (using camel policy or ws-security,
....) user/password & role and check it against realms.

Any idea are welcome ?

Regards,

-- 
Charles Moulliard
Apache Committer / Sr. Enterprise Architect (RedHat)
Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com

Re: Any idea to design a JUnit test for Security/Realm

Posted by Achim Nierbeck <bc...@googlemail.com>.
Hi,

did you take a look at the itest of Pax Web?
Cause there are some authentication test. Might be a good starter at least
for the web part ;)
 Am 12.01.2013 11:30 schrieb "Charles Moulliard" <ch...@gmail.com>:

> Will perhaps developp a Junit LoginContext based on ideas proposed here in
> JDK Security example :
>
> http://docs.oracle.com/javase/6/docs/technotes/guides/security/jaas/tutorials/GeneralAcnOnly.html
>
>
> On Sat, Jan 12, 2013 at 11:03 AM, Charles Moulliard <ch007m@gmail.com
> >wrote:
>
> > Hi,
> >
> > As we have Camel/Karaf projects using JAAS & Realm but until now no unit
> > test allowing to authenticate a user/password & Role against realm deploy
> > in Karaf or in any other Java container (EE, Standalone, Jetty, Tomcat),
> I
> > try to figure out How we could create a class to register realms (during
> > @Before phase of JUnit) and that next we could use in a test with cxf,
> > camel-cxf, osgi service to intercept (using camel policy or ws-security,
> > ....) user/password & role and check it against realms.
> >
> > Any idea are welcome ?
> >
> > Regards,
> >
> > --
> > Charles Moulliard
> > Apache Committer / Sr. Enterprise Architect (RedHat)
> > Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
> >
> >
>
>
> --
> Charles Moulliard
> Apache Committer / Sr. Enterprise Architect (RedHat)
> Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
>

Re: Any idea to design a JUnit test for Security/Realm

Posted by Charles Moulliard <ch...@gmail.com>.
Will perhaps developp a Junit LoginContext based on ideas proposed here in
JDK Security example :
http://docs.oracle.com/javase/6/docs/technotes/guides/security/jaas/tutorials/GeneralAcnOnly.html


On Sat, Jan 12, 2013 at 11:03 AM, Charles Moulliard <ch...@gmail.com>wrote:

> Hi,
>
> As we have Camel/Karaf projects using JAAS & Realm but until now no unit
> test allowing to authenticate a user/password & Role against realm deploy
> in Karaf or in any other Java container (EE, Standalone, Jetty, Tomcat), I
> try to figure out How we could create a class to register realms (during
> @Before phase of JUnit) and that next we could use in a test with cxf,
> camel-cxf, osgi service to intercept (using camel policy or ws-security,
> ....) user/password & role and check it against realms.
>
> Any idea are welcome ?
>
> Regards,
>
> --
> Charles Moulliard
> Apache Committer / Sr. Enterprise Architect (RedHat)
> Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
>
>


-- 
Charles Moulliard
Apache Committer / Sr. Enterprise Architect (RedHat)
Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com

Re: Any idea to design a JUnit test for Security/Realm

Posted by Charles Moulliard <ch...@gmail.com>.
Will perhaps developp a Junit LoginContext based on ideas proposed here in
JDK Security example :
http://docs.oracle.com/javase/6/docs/technotes/guides/security/jaas/tutorials/GeneralAcnOnly.html


On Sat, Jan 12, 2013 at 11:03 AM, Charles Moulliard <ch...@gmail.com>wrote:

> Hi,
>
> As we have Camel/Karaf projects using JAAS & Realm but until now no unit
> test allowing to authenticate a user/password & Role against realm deploy
> in Karaf or in any other Java container (EE, Standalone, Jetty, Tomcat), I
> try to figure out How we could create a class to register realms (during
> @Before phase of JUnit) and that next we could use in a test with cxf,
> camel-cxf, osgi service to intercept (using camel policy or ws-security,
> ....) user/password & role and check it against realms.
>
> Any idea are welcome ?
>
> Regards,
>
> --
> Charles Moulliard
> Apache Committer / Sr. Enterprise Architect (RedHat)
> Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
>
>


-- 
Charles Moulliard
Apache Committer / Sr. Enterprise Architect (RedHat)
Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com