Summary:
every login module in the XMLLoginConfig will be required. sufficient, requisite and
optional flags will be ignored.
In sun JAAS LoginModuleControlFlag class, the toString method returns
LoginModuleControlFlag: then the flag so
LoginModuleControlFlag: required
LoginModuleControlFlag: sufficient
LoginModuleControlFlag: requisite
LoginModuleControlFlag: optional
public static class LoginModuleControlFlag
{
public String toString()
{
return ("LoginModuleControlFlag: " + controlFlag;
}
In JBoss XMLLoginConfig class parseModule the code will check the toString for
equality on just the controlFlag portion:
private void parseModule(Element module, ArrayList entries) throws Exception
{
LoginModuleControlFlag controlFlag = LoginModuleControlFlag.REQUIRED;
String className = module.getAttribute("code");
String flag = module.getAttribute("flag");
if( flag != null )
{
if( flag.equals(LoginModuleControlFlag.REQUIRED.toString()) )
controlFlag = LoginModuleControlFlag.REQUIRED;
else if( flag.equals(LoginModuleControlFlag.REQUISITE.toString()) )
controlFlag = LoginModuleControlFlag.REQUISITE;
else if( flag.equals(LoginModuleControlFlag.SUFFICIENT.toString()) )
controlFlag = LoginModuleControlFlag.SUFFICIENT;
else if( flag.equals(LoginModuleControlFlag.OPTIONAL.toString()) )
controlFlag = LoginModuleControlFlag.OPTIONAL;
}
NodeList opts = module.getElementsByTagName("module-option");
HashMap options = new HashMap();
for(int n = 0; n < opts.getLength(); n ++)
{
Element opt = (Element) opts.item(n);
String name = opt.getAttribute("name");
String value = getContent(opt, "");
options.put(name, value);
}
AppConfigurationEntry entry = new AppConfigurationEntry(className, controlFlag,
options);
entries.add(entry);
}
Since jboss will be comparing "required" to "LoginModuleControlFlag: required" and so
on, none of the checks will evaluate to true, and thus parseModule will use the
default (LoginModuleControlFlag.REQUIRED).
Solution
either make the comparison a "contains(flag)" type of call, or build the flag string
the same way SUN does in their jaas package.
regards,
Matthew
_______________________________________________________________
Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -
http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user