java - Spring Security: anonymousUser blocked from .authenticated() configuration? -
when not logged in spring security, authentication's currentprincipalname anonymoususer , method .authenticated() returns true . however, configuration asks requests authenticated , anonymoususer denied. here configuration code: @override protected void configure(httpsecurity http) throws exception { characterencodingfilter characterencodingfilter = new characterencodingfilter(); characterencodingfilter.setencoding("utf-8"); characterencodingfilter.setforceencoding(true); http.addfilterbefore(characterencodingfilter, csrffilter.class); http .formlogin()//support form login .loginpage("/login") .and() .authorizerequests() .antmatchers("/spitter/me").authenticated() .antmatchers(httpmethod.post, "/spittles").authenticated() .anyrequest().permitall(); } both of 2 antmatchers blocked anonymoususer accessing. there reason why? edit: why duplicate? asking different que