Since no standard available, I use a much simpler approach, i.e. without a 
callback handler or java.security.auth.login.config:

@Override
  |     public boolean authenticate(String name, char[] password, String[] 
roleNames)
  |             throws Exception
  |     {
  |             if (roleNames == null) {
  |                     log.warn("Software bug: must set user roles before 
trying this");
  |                     return false;
  |             }
  |             SecurityAssociation.clear();
  |             SecurityAssociation.setPrincipal(new SimplePrincipal(name));
  |             SecurityAssociation.setCredential(password);
  |             InitialContext ctx = getInitialContext();
  |             roleNameSuccess = null;
  |             AccountDaoR test = (AccountDaoR) 
ctx.lookup("accounting/AccountManager/remote");
  |             roleNameSuccess = test.hasRoles(roleNames);
  |             return roleNameSuccess != null && roleNameSuccess.length > 0;
  |     }

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3928259#3928259

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3928259


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to