1 22 package org.jboss.web.tomcat.security; 23 24 import java.io.IOException ; 25 import java.security.Principal ; 26 import javax.servlet.ServletException ; 27 28 import org.apache.catalina.connector.Request; 29 import org.apache.catalina.connector.Response; 30 import org.apache.catalina.valves.ValveBase; 31 32 42 public class CustomPrincipalValve 43 extends ValveBase 44 { 45 public void invoke(Request request, Response response) 46 throws IOException , ServletException 47 { 48 Principal user = request.getUserPrincipal(); 49 if( user instanceof JBossGenericPrincipal ) 50 { 51 JBossGenericPrincipal guser = (JBossGenericPrincipal) user; 53 Principal realUser = guser.getCallerPrincipal(); 54 request.setUserPrincipal(realUser); 55 } 56 57 getNext().invoke(request, response); 58 } 59 } 60 | Popular Tags |