title: Can't authenticate user using React and Spring Security
body: <p>i am trying to login to my app via front written in React. The method which is responsible for form login. Button invoke this method:</p>
  
  <pre><code>handleSubmit = event =&gt; {
          event.preventDefault();
          PostData('perform_login', this.state).then((result) =&gt; {
            let responseJSON = result;
        console.log(responseJSON);
      });
    }
  </code></pre>
  
  <p>And this is a Data with username and password    </p>
  
  <pre><code>export function PostData(type, userData) {
  
    let BaseUrl = 'http://localhost:8080/';
  
    return new Promise((resolve, reject) =&gt; {
      fetch(BaseUrl + type, {
        method: 'POST',
        body: JSON.stringify(userData)
      })
      .then((response) =&gt; response.json())
      .then((responseJson) =&gt; {
        resolve(responseJson);
      })
      .catch((error) =&gt; {
        reject(error);
      });
    });
  }
  </code></pre>
  
  <p>I am trying to log in to backend, spring config looks like that:</p>
  
  <pre><code>@Override
    protected void configure(final HttpSecurity http) throws Exception {
      http
            .cors()
          .and()
            .csrf().disable()
            .exceptionHandling().authenticationEntryPoint(restAuthenticationEntryPoint)
          .and()
            .authorizeRequests()
            .antMatchers("/login*", "/success*").anonymous()
            .antMatchers("/auth/**", "/signup/**", "/css/*", "/webjars/**","/js/*","/image/*").permitAll()
            .anyRequest().authenticated()
          .and()
            .formLogin()
            .successHandler(mySuccessHandler)
            .failureHandler(myFailureHandler)
            .loginProcessingUrl("perform_login")
            .usernameParameter("username")
            .passwordParameter("password")
            .successForwardUrl("/tasks")
          .and()
            .logout()
            .logoutUrl("/logout")
            .logoutSuccessUrl("/logout-success").permitAll()
          .and()
            .apply(new SpringSocialConfigurer());
    }
  </code></pre>
  
  <p>Important line in this file i think is the loginProcessingUrl("perform_login") which i used to verify my username and password from react.</p>
  
  <p>While i do something like that in CURL is working fine:</p>
  
  <pre><code>curl -i -X POST -d username=admin -d password=admin http://localhost:8080/perform_login
  </code></pre>
  
  <p>But if i want authenticate by Postman or React it doesn't work, please about help/hints
  Regards</p>