User: salborini
Date: 00/11/02 10:02:47
Added: tomcat/src/main/org/jboss/tomcat/security JbossRealm.java
Log:
JNDI and security integration for EmbeddedTomcatService
Submitted by Kevin Lewis <[EMAIL PROTECTED]>
Revision Changes Path
1.1
contrib/tomcat/src/main/org/jboss/tomcat/security/JbossRealm.java
Index: JbossRealm.java
===================================================================
package org.jboss.tomcat.security;
import java.security.Principal;
import java.util.Hashtable;
import org.apache.tomcat.core.Request;
import org.apache.tomcat.core.Response;
import org.apache.tomcat.util.SecurityTools;
import org.apache.tomcat.core.BaseInterceptor;
import org.jboss.system.SecurityAssociation;
import org.jboss.system.SimplePrincipal;
/**
* This maps Tomcat credintials to jBoss credintials. It can probably be placed
after
* many other Tomcat realms to map that realm into jBoss.
* @author <a href="mailto:[EMAIL PROTECTED]">Kevin Lewis</a>
* @version $Revision: 1.1 $
*/
public class JbossRealm extends BaseInterceptor {
public int authenticate( Request req, Response response ){
Hashtable cred=new Hashtable();
SecurityTools.credentials( req, cred );
String user=(String)cred.get("username");
SecurityAssociation.setPrincipal( new SimplePrincipal( user ) );
return 0;
}
}