[jboss-user] [JBoss Seam] - SeamTest & Form based authentication

eiswind do-not-reply at jboss.com
Tue Jan 23 10:52:05 EST 2007


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();
So the test needs to login anyhow. Following is what I found through googling:
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();
  |             
  |         }
with jaas.config looks like
example {  org.jboss.security.ClientLoginModule required;};
but the principal I get from the FacesContext is always named "gavin". The CallBackHandler is invoked and gives my correct identification. What can I do to get the principal right ? Any ideas ?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4005353#4005353

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4005353



More information about the jboss-user mailing list