Skip to content

Tag: endpoint

endpoint for authentication with spring security

I wanna create custom endpoint for login. It works fine when password and username are correct but returns 200 and login form instead 401 for incorrect data. public class SecurityConfiguration extends WebSecurityConfigurerAdapter { private final UserDetailsService userDetailsService; } Answer Try something like that: Don’t forget to Autowire AuthenticationManager and other services!