Hi,
I'm writing my own valve to authenticate http requests, I'm getting the realm from catalina context and invoking the authenticate method(String, String).
The realm used is by jboss is JBossSecurityMgrRealm (the default) but when this realm looks for the security context the JNDI lookup fails :
public class JBossSecurityMgrRealm extends RealmBase implements Realm, Valve
{
...
private Context getSecurityContext()
{
Context securityCtx = null;
// Get the JBoss security manager from the ENC context
try
{
InitialContext iniCtx = new InitialContext();
securityCtx = (Context) iniCtx.lookup("java:comp/env/security");
}
catch (NamingException e)
{
// Apparently there is no security context?
}
return securityCtx;
}
...
}
I configured the valve in $JBOSS_HOME/server/default/deploy/jbossweb-tomcat50.sar/server.xml file :
</Host>
...
<Valve className="org.josso.agent.SSOAgentValve" debug="1"/>
...
</Host>
I'm using jboss 3.2.5 (tomcat 5.0.26)
The problem is that when invoking the realm from my onw valve, the JNDI context is not properly set, and the realm can't find the security context.
Any ideas ?
Thx,