-
1. Re: How to test JAAS on Application Server(JB7,GF3)
aslak Jan 4, 2012 3:55 PM (in response to hantsy)1 of 1 people found this helpful -
2. Re: How to test JAAS on Application Server(JB7,GF3)
kpiwko Jan 5, 2012 5:09 AM (in response to hantsy)1 of 1 people found this helpfulAnother way is to use Arquillian Drone and create a functional test, based on UI your application provides, which exercises JAAS part of the application.
-
3. Re: How to test JAAS on Application Server(JB7,GF3)
hantsy Jan 5, 2012 5:58 AM (in response to hantsy)Thanks.
I noticed JSFUnit provdied @BasicAuthentication, @FormAnthentication, if these can be applied to other cases, I think the JAAS test will become more easy.
-
4. Re: How to test JAAS on Application Server(JB7,GF3)
sfcoy Jan 5, 2012 7:19 PM (in response to aslak)I've been wondering about how to do this myself, and I had seen this example.
The JNDI login looks container specific though. Is that right?
In my case I want to be able to test role membership deep inside some business code that is a long way from the GUI, so I'm not sure that the other suggestions make a lot of sense.
-
5. Re: How to test JAAS on Application Server(JB7,GF3)
hantsy Jan 7, 2012 6:06 AM (in response to aslak)ArquillianContext seems decprated , I can not find it in the arquillian 1.0CR6.
I hope there is a simple way to add authencation to the EJBContext in arquillan like the jsfunit I motioned above.
-
6. Re: How to test JAAS on Application Server(JB7,GF3)
hantsy Jan 7, 2012 6:24 AM (in response to hantsy)Oh, it is OpenEJB container specific API, how to do this in JBoss AS.
-
7. Re: How to test JAAS on Application Server(JB7,GF3)
hantsy Jan 7, 2012 6:26 AM (in response to hantsy)I think two features currently I need to test a seucred EJB.
1. simple way to disable EJB security, thus I can test the business logic directly.
2. simple way to add authentication to EJBContext, thus I can test the security settings.
-
8. Re: How to test JAAS on Application Server(JB7,GF3)
hantsy Jan 7, 2012 8:59 AM (in response to kpiwko)I know this is another approach for testing the JAAS settings....but current I only want to test the EJB class itselft.
-
9. Re: How to test JAAS on Application Server(JB7,GF3)
magnus.smith Jan 17, 2012 2:18 PM (in response to hantsy)have a look at this.
Its Glassfish specific but works quite successfully for me.
basically you create a jass security realm with some users in a glassfish server and then configure the embedded glassfish to use the same instance root.
you can then use the programatic login to login your users and then run you tests against your secure ejb methods.
-
10. Re: How to test JAAS on Application Server(JB7,GF3)
sfcoy Jan 25, 2012 8:16 AM (in response to hantsy)I figured out how to do this and wrote an article at Testing secured EJBs on JBoss AS7.1.x with Arquillian.
Hopefully you will find that useful.
-
11. Re: How to test JAAS on Application Server(JB7,GF3)
bmajsak Jan 25, 2012 9:33 AM (in response to sfcoy)Awesome! Thanks a lot for this great contribution.