title: PreAuthorize("isAuthenticated()") not working on RestController
body: <p>I found many similar questions but none has solved my problem my problem is:
  PreAuthorize("isAuthenticated()") not working on my RestController.</p>
  
  <p>my configuration security is:</p>
  
  <pre><code>&lt;global-method-security pre-post-annotations="enabled"/&gt;
  &lt;authentication-manager alias="authenticationManager"&gt;
          &lt;authentication-provider&gt;
              &lt;password-encoder ref="passwordEncoder" /&gt;
              &lt;jdbc-user-service
                  data-source-ref="dataSource"
                  users-by-username-query="
           select login,password,1
           from test tst where tst.login=?" 
                  authorities-by-username-query="
           select login,'ROLE_SAVE' from test tst where tst.login=?"
              /&gt;
          &lt;/authentication-provider&gt;
      &lt;/authentication-manager&gt; 
  </code></pre>
  
  <p>on my RestController i add this annotation:@PreAuthorize("isAuthenticated()")</p>
  
  <pre><code>@RestController
  @PreAuthorize("isAuthenticated()")
  @RequestMapping("/api/test")
  public class PrinterController{
  
      @RequestMapping(value = "", method = RequestMethod.GET)
      public ResponseStatus test() {
      System.out.println("test");
  }
  </code></pre>
  
  <p>but not work any user can consume this resource.</p>