I use Spring Security
(version 3.0.5.RELEASE
). Here is my XML config settings:
<security:http>
<security:http-basic/>
</security:http>
Spring provides me a message when I try to get access to the system:
A username and password are being requested by http://localhost:8080. The site says "Spring Security Application"
I want to change a message Spring Security Application
to another one. I tried to use a handler:
<security:access-denied-handler ref="accessDeniedHandler"/>
My Java bean:
public class MyAccessDeniedHandler implements AccessDeniedHandler {
@Override
public void handle(HttpServletRequest req, HttpServletResponse resp, AccessDeniedException exception) throws IOException, ServletException {
resp.setHeader("WWW-Authenticate", "Basic realm=\"My authenticate\"");
}
}
But it does not work. How can I change the message?
UPD
The problem in the header. It contains next ket-value: WWW-Authenticate:Basic realm="Spring Security Application"
. Even if I set auto-config <security:http auto-config="true">
my code does not work.