I am integrating Spring Security in my first Angular project. I followed many articles and examples including this, this, this, this and this. I want my application to have
@SK
The reason you are getting the below exception is you are using Controller and not RestController.
org.thymeleaf.exceptions.TemplateInputException: Error resolving template "login", template might not exist or might not be accessible by any of the configured Template Resolvers at org.thymeleaf.TemplateRepository.getTemplate(TemplateRepository.java:246) at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1104)
So instead of directly writing the output to browser as JSON, it is doing ViewResolver to resolve the view part of MVC.
Replacing Controller with RestController will make the .formLogin().loginPage("/login")
to make the browser request with login, and as it permitted you will get the login page of angular.
httpBasic, it is the nature of browser for pop up as it gets a 401 response code.