1
votes

I've just implemented Spring Boot Security in my Grails 3.0.1. I want to customize the default Spring Boot login form, but I can't find the login.html anywhere.

I've read all kinds of tutorials and documentations and the login.html location should be in "src/main/resources/templates/login.html" which does not exist in my project.

Here is the 3 part tutorial series that I followed while implementing Spring Boot to Grails 3.0.1 http://spiesdavid.blogspot.fi/2015/03/grails-3-app-with-security-part-1.html

1
The default login page is generated by a servlet Filter it isn't a physical file. - M. Deinum
Thanks for the quick answer. Is there any way to customize the login form then? Should I just do my own login controller and login.gsp file? - HyperParameter
Not sure how to configure it in Grails but you can specify the login page in normal Spring Security configuration. No need for a controller. - M. Deinum
Where is the configuration located in normal Spring security? Is it the web.xml? - HyperParameter
No in your security configuration yu can specify the login-form. - M. Deinum

1 Answers

0
votes

I solved that problem, there is a lot of work to do. I needed to create 2 controllers, one of them was my new login page's controller and another to submit the login form (empty). The next step is creating an interceptor, it will capure the requests to the second controller, and in the before method, it will do the login process (it must have a reference to the AuthenticationManager, by default a ProviderManager) Finally, I created a new authentication provider, responsible for making authentication, and it must be assigned to AuthenticationManager