openejb-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thiago Veronezi <thi...@veronezi.org>
Subject Re: JUnit: Sessioncontext.isCallerInRole allways returns false
Date Fri, 04 Feb 2011 16:38:18 GMT
Hi,
I'm glad to hear that. An example says more than a thousand words, so check
this code I've implemented for you here...

http://dl.dropbox.com/u/1459144/security.zip

It is doing exactly what you want.

[]s,
Thiago.


On Fri, Feb 4, 2011 at 10:37 AM, ndegraev <nick.degraeve@telenet.be> wrote:

>
> That was really helpful! Thanks. But wait, I'm not there yet...
>
> I decided to use PropertiesLoginModule and now I can login.
>
> I defined the roles I want to use in my unit tests in ejb-jar.xml:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <j2ee:ejb-jar
>                version="3.0"
>                xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"
>                xmlns:xml="http://www.w3.org/XML/1998/namespace"
>                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>                xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
> http://java.sun.com/xml/ns/j2ee/ejb-jar_3_0.xsd ">
>
>        <j2ee:assembly-descriptor>
>                <j2ee:security-role>
>                        <j2ee:role-name>role1</j2ee:role-name>
>                </j2ee:security-role>
>                <j2ee:security-role>
>                        <j2ee:role-name>role2</j2ee:role-name>
>                </j2ee:security-role>
>        </j2ee:assembly-descriptor>
>
> </j2ee:ejb-jar>
>
> Where do I put this? In src/main/resources/META-INF,
> src/test/resources/META-INF or both?
>
> And where do I map my JAAS groups to J2EE roles? Probably in the
> openejb-jar.xml?
>
> Not a lot of documentation on how to do it, though, so any help is welcome.
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/JUnit-Sessioncontext-isCallerInRole-allways-returns-false-tp3257408p3260388.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message