I have a java-web application using struts2 in combination with old servlets. Using Acegi Security.
In my servlets, I log what the user is trying to do and what user he is. To get user im using request.getRemoteUser()
But to my great supprise, the result is not consistent. In most cases, getRemoteUser() returns the correct username, but each time I get a null value.
What could be the reason for this?
EDIT: After your feedback, I realized that servlet links are not protected at all. This can cause the value of getRemoteUser() to be zero. Now I will implement security for them and do some more tests before posting the results.
source share