users@glassfish.java.net

Re: GFv3 Custom Principal

From: <glassfish_at_javadesktop.org>
Date: Mon, 17 May 2010 06:18:56 PDT

Hi,

The PolicyContext.getContext the one of the possible solution of custom principal.

Attila.

Subject subject = (Subject) PolicyContext.getContext("javax.security.auth.Subject.container");
if ((subject != null)) {
   System.out.println("PRINCIPALS");
   if (subject.getPrincipals().size() > 0) {
      Iterator prIterator = subject.getPrincipals().iterator();
      while (prIterator.hasNext()) {
        System.out.println(prIterator.next().getClass().getName());
      }
   }
}
[Message sent by forum member 'aszomor']

http://forums.java.net/jive/thread.jspa?messageID=470144