Change login page for spring security plugin in grails

ぃ、小莉子 提交于 2020-01-12 04:44:10

问题


Is there a way that I can create my own custom login page and send the data to login controller of spring security plugin. I currently see my code redirecting directly to the default login page of spring security plugin.


回答1:


The 2.0 plugin comes with its own auth.gsp page, so if you create your own (either modify the plugin's or create your own) and put it in grails-app/views/login/auth.gsp it will be used. In 1.2.x the auth.gsp is in your app source, so edit it there.

If you want to further customize the login process, I did a talk at http://burtbeckwith.com/blog/?p=1090 and there's some sample code that adds a 3rd login parameter. That code is based on the 1.2.x plugin and would need to be updated for 2.0, but the ideas are the same.




回答2:


I copied the file auth.gsp from here:

https://github.com/grails-plugins/grails-spring-security-core/blob/master/grails-app/views/login/auth.gsp

to grails-app/views/login/auth.gsp



来源:https://stackoverflow.com/questions/20911000/change-login-page-for-spring-security-plugin-in-grails

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!