I try to write a SeamTest. Our application uses container authentication via Form based login. The tested bean accesses the logged in Principal via
FacesContext.getCurrentInstance().getExternalContext().getUserPrincipal().getName();
UsernamePasswordHandler handler = null;
handler = new UsernamePasswordHandler("JU_benutzer1", "JU_benutzer1#");
System.setProperty("java.security.auth.login.config", "I:/work/asd/asd-biz/classes/test/jaas.config");
try {
LoginContext lc = new LoginContext("example", handler);
lc.login();
}example { org.jboss.security.ClientLoginModule required;};Override Request.getUserPrincipalName() and have it do whatever you like.