title: How to allow anonymous user access from localhost only in Spring security?
body: <p>I want to allow only requests from localhost for a specific URL pattern. I tried this so far:    </p>
  
  <pre><code>&lt;sec:intercept-url pattern="/blabla/**" access="hasIpAddress('127.0.0.1')" /&gt;
  </code></pre>
  
  <p>But this isn't working and I got the following statement in the log output:</p>
  
  <pre><code>Access is denied (user is anonymous); redirecting to authentication entry point
  </code></pre>
  
  <p>So my question is, how do I allow anonymous user access from localhost only?</p>