Spring Security

0

Czemu Spring zwraca kod 401 przy próbie POST do /register?

@Override
    protected void configure(HttpSecurity http) throws Exception {
        http
                .authorizeRequests()
                    .anyRequest().authenticated()
                    .antMatchers("/register").permitAll()
                .and().httpBasic()
                .and().csrf().disable();
    }
0

Nie wiem czy to ant matchers register nie jest domyślnie tylko dla GET.

0

Próbowałem też

.antMatchers(POST, "/register").permitAll()

Ale niestety nic nie zmieniło

0

Pomogło dodanie

.and().formLogin().permitAll()

Ktoś może wytłumaczyć dlaczego?

1 użytkowników online, w tym zalogowanych: 0, gości: 1