After 30 mins of trial and error I finally found out why my sample was not working. Even Spring Security engineers sometimes forget about CSRF protection 🤦♂️
One of the most asked questions about Spring Security is how to publish your own AuthenticationManager bean for custom authentication scenarios. The official documentation has that use case covered for you:
docs.spring.io/spring-securit…
Publiquei um novo vídeo sobre Authn e Authz com Spring Security. Nesse vídeo eu explico alguns conceitos básicos do framework que eu acredito que sejam a base pra quem quer usar o Spring Security em uma aplicação.