title: spring security authentication using ip address and username password
body: <p>I am using loadUserByUsername method to authenticate user, however, I need to validate against allowed ip addresses as well.</p>
  
  <p>But when I am trying </p>
  
  <pre><code>SecurityContextHolder.getContext().getAuthentication(); 
  </code></pre>
  
  <p>getting null.</p>
  
  <p>Please advice, how I can access users client ip address while authenticating user.</p>