users@glassfish.java.net

RE: Security role names?

From: Martin Gainty <mgainty_at_hotmail.com>
Date: Tue, 2 Aug 2011 17:49:06 -0400

step 6 in configuring JDBCRealm or DAR (Modify the deployment descriptor to specify the jdbc realm)

Modify the deployment descriptor that is associated with your application.

For an enterprise application in an Enterprise Archive (EAR) file, modify the sun-application.xml
file.For a web application in a Web Application Archive (WAR) file, modify the
web.xml file.For an enterprise bean in an EJB JAR file, modify the sun-ejb-jar.xml
 file.

http://download.oracle.com/docs/cd/E18930_01/html/821-2435/ggkuk.html#giwlt

Martin Gainty
______________________________________________
Jogi és Bizalmassági kinyilatkoztatás/Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 Ez az
üzenet bizalmas. Ha nem ön az akinek szánva volt, akkor kérjük, hogy
jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának
készítése nem megengedett. Ez az üzenet csak ismeret cserét szolgál és
semmiféle jogi alkalmazhatósága sincs. Mivel az electronikus üzenetek
könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet
ezen üzenet tartalma miatt.

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut ętre privilégié. Si vous n'ętes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert ŕ l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement ętre sujets ŕ la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.


Date: Tue, 2 Aug 2011 14:12:10 -0400
Subject: Security role names?
From: ljnelson_at_gmail.com
To: users_at_glassfish.java.net

Suppose I have an EJB in its own jar inside an ear file, and I want to use Ron Monzillo's trick for getting a list of roles that a user has (http://blogs.oracle.com/monzillo/entry/using_jacc_to_determine_a).


Suppose further that the EJB has a glassfish-ejb-jar.xml file in its META-INF directory that lists some group-to-role bindings.

Let's assume I have an authenticated principal that logs in to the container and by doing so should get roles A, B and C (i.e. that we've mapped groups that the user is in to roles A, B and C using the glassfish-ejb-jar.xml file).


The printout from this EJB is not returning the role list I would expect. Do I need to do something else (like put in a glassfish-application.xml file)? Does the glassfish-application.xml override the bindings of the glassfish-ejb-jar.xml file?


Thanks,
Laird