Calling
<acegijsf:authentication operation="username"/>
on a jsp, when the user is not authenticated yet (so no username is net in acegis security context), causes a NullPointerException because the username is null.
Instead an empty string should be returned in that case.
Logged In: YES
user_id=1630113
Originator: YES
The bugfix in class "net.sf.jsfcomp.acegijsf.Authentication" would be:
change:
public void encodeBegin(FacesContext context) throws IOException {
ResponseWriter writer = context.getResponseWriter();
if (getOperation().equals("username")) {
String username = getRequest().getRemoteUser();
writer.write(username);
}
}
to
public void encodeBegin(FacesContext context) throws IOException {
ResponseWriter writer = context.getResponseWriter();
if (getOperation().equals("username")) {
String username = getRequest().getRemoteUser();
if(null == username){
username="";
}
writer.write(username);
}
}
Logged In: YES
user_id=1630113
Originator: YES
File Added: Authentication.java
the class with the bugfix
Logged In: YES
user_id=1630113
Originator: YES
File Added: Authentication.java