简体   繁体   English

更改grails中spring security plugin的登录页面

[英]Change login page for spring security plugin in grails

Is there a way that I can create my own custom login page and send the data to login controller of spring security plugin. 有没有办法可以创建自己的自定义登录页面并将数据发送到spring security插件的登录控制器。 I currently see my code redirecting directly to the default login page of spring security plugin. 我目前看到我的代码直接重定向到spring security plugin的默认登录页面。

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. 2.0插件附带了自己的auth.gsp页面,所以如果你自己创建(修改插件或创建自己的插件)并将其放在grails-app / views / login / auth.gsp中,它将被使用。 In 1.2.x the auth.gsp is in your app source, so edit it there. 在1.2.x中,auth.gsp位于您的应用源代码中,因此请在其中进行编辑。

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. 如果你想进一步自定义登录过程,我在http://burtbeckwith.com/blog/?p=1090上做了一个演讲,并且有一些示例代码添加了第三个登录参数。 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. 该代码基于1.2.x插件,需要针对2.0进行更新,但这些想法是相同的。

I copied the file auth.gsp from here: 我从这里复制了auth.gsp文件:

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

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM