title: Authentication object is null after bypassing the particular request
body: <p>The below Code I used in webConfigSecurity class to bypass some requests from the client</p>
  <pre><code>@Override
  public void configure(WebSecurity webSecurity) throws Exception
  {
      webSecurity.ignoring().antMatchers(&quot;/adminSettings/get/**&quot;)
               .antMatchers(&quot;/cases/sayHello/**&quot;).antMatchers(&quot;/cases/**/downloadPdfFolderPBC/**&quot;);
  }
  </code></pre>
  <p>In the controller api method requires the user details for further execution, while getting the user details the authentication object is null, so it throws an exception that &quot;user is not authenticated&quot;</p>
  <pre><code> public static User get() {
          final Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
          if (authentication != null) {
              UserPrincipal principal = (UserPrincipal) authentication.getPrincipal();
              if (principal == null) {
                  throw new InsufficientAuthenticationException(&quot;User not authenticated&quot;);
              }
              return principal.getUser();
          }
          throw new AuthenticationCredentialsNotFoundException(&quot;User not authenticated&quot;);
      }
  </code></pre>
  <p>I'm new to spring security, In this case, what I should do to get logged user details</p>