title: Spring basic auth logout not working in firefox
body: <p>I am trying to implement logout for site with basic authentication with spring boot.
  <strong>The below solution works only for chrome not working in firefox</strong></p>
  
  <pre><code>@EnableGlobalMethodSecurity(prePostEnabled = true)
  @EnableWebSecurity
  @Configuration
  public class SecurityConfig extends WebSecurityConfigurerAdapter {
  
      @Autowired
      private UserDetailsService userDetailsService;
  
      @Override
      public void configure(HttpSecurity http) throws Exception {
          http
          .antMatcher("/**")
          .authorizeRequests()
              .antMatchers("/js/**", "/fonts/**", "/css/**", "/images/**", "/againlogin**")
              .permitAll()  
          .anyRequest()
              .fullyAuthenticated()
          .and().httpBasic()
          .and().csrf().disable();
      }
  
  
  }
  </code></pre>
  
  <p>From html I trigger ajax call for logout</p>
  
  <pre><code>&lt;a href="javascript:logoutUser()"&gt;Logout&lt;/a&gt;
  </code></pre>
  
  <p>In Javascript</p>
  
  <pre><code>   function logoutUser() {
      ClearAuthentication("/againlogin.html");    
  }
  
  function ClearAuthentication(LogOffPage) 
  {
     var IsInternetExplorer = false;    
  
     try
     {
         var agt=navigator.userAgent.toLowerCase();
         if (agt.indexOf("msie") != -1) { IsInternetExplorer = true; }
     }
     catch(e)
     {
         IsInternetExplorer = false;    
     };
  
     if (IsInternetExplorer) 
     {
        // Logoff Internet Explorer
        document.execCommand("ClearAuthenticationCache");
        window.location = LogOffPage;
     }
     else 
     {
        // Logoff every other browsers
    $.ajax({
         username: 'unknown',
         password: 'WrongPassword',
             url: '/logout',
         type: 'GET',
         beforeSend: function(xhr)
                 {
            xhr.setRequestHeader("Authorization", "Basic AAAAAAAAAAAAAAAAAAA=");
         },
  
                 error: function(err)
                 {
                    window.location = LogOffPage;
             }
    });
     }
  }
  </code></pre>
  
  <p>I am not getting logged out.</p>
  
  <p>Can some help me fix this issue</p>