在使用grails spring security core plugin时,实现用户登录的时候更新上次登录时间
在Config.groovy添加如下代码:
import com.myapp.User
grails.plugins.springsecurity.useSecurityEventListener = true
grails.plugins.springsecurity.onInteractiveAuthenticationSuccessEvent = { e, appCtx ->
User.withTransaction {
def user = User.findById(appCtx.springSecurityService.principal.id)
if(!user.isAttached())
user.attach()
user.lastLoginDate = new Date()
user.save(flush: true, failOnError: true)
}
}
Reference:
http://stackoverflow.com/questions/5868311/changing-last-login-date-in-grails-with-spring-security
分享到:
相关推荐
详情地主:https://blog.csdn.net/qq_38425662/article/details/82703128
打开Grails命令行并运行create-app grails3-spring-security-demo --profile=web 更新了grails-app/conf/logback.groovy并添加了以下内容: // added so that we get more of the Spring Boot startup logger( ' ...
Grails-Springsecurity-username-email-login 此种子用于在您的应用程序中配置 spring 安全性并启用使用用户名或电子邮件登录 vai Grails spring 安全性插件仅支持通过用户名登录。 如果您需要通过用户名或密码启用...
用于Grails的Spring Security REST Grails插件使用Spring Security实现基于令牌的无状态RESTful身份验证。 由赞助和支持 说明文件: 。 。使用此插件的公司熊猫熊猫Zana Technologies GmbH 您是否正在使用此插件,并...
Spring Websocket Grails插件 该插件旨在使Spring 4.0中引入的websocket支持可用于Grails应用程序。 您也可以使用相应的Spring docs / apis / samples作为参考。 在本自述文件中多次提到了这一点,因为其中详细...
Grails Spring安全核心插件 请参阅以获取更多信息。 分支机构 master与Grails 4.x兼容 3.3.x使用Grails 3.3.x兼容 3.2.x使用Grails 3.2.x中兼容
grails-3-with-security 这是在Grails 3应用程序中使用spring-boot-security-starter的示例。 有关该代码的逐步介绍,请访问我的博客, , ,
Grails Spring Security用户界面
grails-boot Grails 与 Spring Boot 的集成GORM Spring Boot 插件已移至
Spring Security 3.1.pdf
上面的行将在您的应用程序中安装 spring security rest 插件。 步骤 3. 在您的 grails 应用程序中创建一个新域 AuthToken,它将在用户登录 AuthToken.groovy 时存储身份验证令牌 class AuthToken { String ...
"Getting Started with Grails" brings you up to speed on this modern web framework. Companies as varied as LinkedIn, Wired, Tropicana, and Taco Bell are all using Grails. Are you ready to get started ...
Spring Batch PoC Grails Spring Batch、启用 CORS 的 REST API、Spring Security Core/LDAP 演示先决条件 # GVM - Tool for managing Groovy related frameworks curl -s get.gvmtool.net | bash # install Grails ...
Grails In Action.pdf ebook
Grails in Action pdf
contract-last with XFire, and contract–first through Spring Web Services. * Spring’s unit and integration testing support (on JUnit 3.8, JUnit 4, and TestNG). * How to secure applications using ...
10. Spring with other Web Frameworks 11. Data Access 12. Spring Transaction Management 13. Spring Batch 14. Spring NoSQL and Big Data 15. Spring Java Enterprise Services and Remoting Technologies 16....
关于用于RADIUS身份验证的Grails插件。作者: 萨米·麦凯拉(SamiMäkelä)
grails 用户登录的例子,必须登录后才可以查看信息,并且只有admin用户才可以创建用户,此例子,只要将grails 的环境配好,就可以用了,用的是自带的数据库,如果需要mysql 可以更改。
Grails is a full stack web development framework that enables you to build complete web applications in a fraction of the time and with less code than other frameworks. In Grails: A Quick-Start Guide...