Spring Security AngularJS Login
<p>I have a Spring Boot application and configured spring security to it, it uses a custom login page with a simple AngularJS form and i'm trying to authenticate through it but unsuccessfully. On my CurrentUserDetailsService loadUserByUsername(String param) the parameter <code>param</code>comes null everytime, can someone help me ? am i missing something? </p>

<p>This is my form :</p>

<pre><code>&lt;form role="form" action="" name="form" class=""&gt;
        &lt;fieldset class="pure-group"&gt;
            &lt;legend&gt;Log In&lt;/legend&gt;
            &lt;div class="form-group"&gt;
                &lt;label for="username"&gt;Username:&lt;/label&gt; 
                &lt;input type="text" class="form-control" id="username" name="username" ng-model="credentials.username"/&gt;
            &lt;/div&gt;
            &lt;div class="form-group"&gt;
                &lt;label for="password"&gt;Password:&lt;/label&gt; 
                &lt;input type="password"  class="form-control" id="password" name="password" ng-model="credentials.password"/&gt;
            &lt;/div&gt;
            &lt;button ng-click="onLogin($event)" type="submit" class="btn btn-primary"&gt;Submit&lt;/button&gt;
        &lt;/fieldset&gt;
    &lt;/form&gt;
</code></pre>

<p>This is my js:</p>

<pre><code>$scope.onLogin = function($event){
     $event.preventDefault();
     $http({
         method: 'POST',
         url:'/login',
         data: $scope.credentials
     })  
}   
</code></pre>

<p>This is my security configuration :</p>

<pre><code>@Override
    protected void configure(HttpSecurity http) throws Exception {
        http
        .authorizeRequests()
        .antMatchers("/newuser","/create").permitAll()
        .antMatchers("/css/**").permitAll()
        .antMatchers("/js/**").permitAll()
        .antMatchers("/**").hasRole("USER").anyRequest().authenticated()
        .and()
        .formLogin()
        .loginProcessingUrl("/login")
        .usernameParameter("username")
        .passwordParameter("password")
        .defaultSuccessUrl("/index.html")
        .loginPage("/loginpage.html")
        .and()
        .httpBasic()
        .and()
        .logout()
        .logoutUrl("/logout")
        .logoutSuccessUrl("/loginpage.html")
        .permitAll()
        .and()
        .csrf().csrfTokenRepository(csrfTokenRepository())
        .and()
        .addFilterAfter(new CsrfHeaderFilter(), CsrfFilter.class);

    }
</code></pre>

<p>and this is the exception i'm getting everytime:</p>

<pre><code>org.springframework.security.authentication.InternalAuthenticationServiceException: Cannot pass null or empty values to constructor
</code></pre>

<p>Also would like to mention that through my POST request username and password are sended</p>

<p><a href="https://i.stack.imgur.com/mHzmY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mHzmY.png" alt="enter image description here"></a></p>

<p>I tried with j_username and j_password but nothing.</p>