title: Stateless Application Spring Security
body: <p>I'm creating a Spring boot application with Spring Web,Spring Security and Spring social. The application contains rest services that utilizes basic authentication for security. I"m trying to configure Spring to make the application stateless, however when I use the browser to make requests to the web services the browser prompts for user credential but all prior request use the same user credential because of session creation. I have configured the application to stop this from happening but still having the problem. \</p>
  
  <pre><code>public class SecurityConfig extends WebSecurityConfigurerAdapter{
      @override
      protected void configure(HttpSecurity http) throws Exception{
          http.sessionManagement()
              .sessionCreationPolicy(SessionCreationPolicy.STATELESS)
              .and()
              .csrf().disable()
              .authorizeRequests()
              .antMatchers("/api/**")
              .hasRole("USER")
              .andBasic();
      }
  
      @override
      protected void configure(AuthenticatioinManagerBuilder auth) throws Exception {
          auth.inMemoryAuthentication()
              .withUser("some@gmail.com")
              .password("12345")
              .role("USER");
      }
  }
  </code></pre>
  
  <p>What should I change or add to get this functionality.</p>