微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

CAS怎么配置RememberMe

这篇文章主要讲解了“CAS怎么配置RememberMe”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“CAS怎么配置RememberMe”吧!

具体内容

如果要想配置RememberMe的操作需要考虑到两个配置部分:Shiro(WEB端)、CAS。1、修改applicationContext.xml文件,为其追加一个工厂类:

<!--如果要想实现CAS端的RememberMe的功能,一定需要使用以下的处理类完成--><beanid="casSubjectFactory"class="org.apache.shiro.cas.CasSubjectFactory"/><!--配置SecurityManager的管理--><beanid="securityManager"class="org.apache.shiro.web.mgt.DefaultWebSecurityManager"><!--配置你需要使用的Realms--><propertyname="realm"ref="memberRealm"/><propertyname="subjectFactory"ref="casSubjectFactory"/><propertyname="cacheManager"ref="cacheManager"/><!--定义要使用的session管理器--><propertyname="sessionManager"ref="sessionManager"/><!--定义RememberMe的管理器--><propertyname="rememberMeManager"ref="rememberMeManager"/></bean>

2、修改“deployerConfigContext.xml”配置文件

CAS怎么配置RememberMe

3、修改另外一个页面配置文件:cas\WEB-INF\webflow\login\login-webflow.xml

CAS怎么配置RememberMe

4、修改“cas\WEB-INF\spring-configuration\ticketExpirationPolicies.xml”文件

CAS怎么配置RememberMe

CAS怎么配置RememberMe

5、修改“cas\WEB-INF\spring-configuration\ticketGrantingTicketCookieGenerator.xml”。

CAS怎么配置RememberMe

6、此时对于记住我这个信息实际上还没有提示内容,所以需要修改一个资源文件

·文件路径:cas\WEB-INF\classes\messages_zh_CN.properties

screen.welcome.label.rememberme=记住我screen.welcome.label.rememberme.accesskey=r

7、修改页面显示:cas\WEB-INF\view\jsp\default\ui\casLoginView.jsp

CAS怎么配置RememberMe

8、将各个文件拷贝到各个目标位置上:

mv/srv/ftp/deployerConfigContext.xml/usr/local/tomcat/webapps/cas/WEB-INF/mv/srv/ftp/login-webflow.xml/usr/local/tomcat/webapps/cas/WEB-INF/webflow/login/mv/srv/ftp/ticketExpirationPolicies.xml/usr/local/tomcat/webapps/cas/WEB-INF/spring-configuration/mv/srv/ftp/ticketGrantingTicketCookieGenerator.xml/usr/local/tomcat/webapps/cas/WEB-INF/spring-configuration/mv/srv/ftp/messages_zh_CN.properties/usr/local/tomcat/webapps/cas/WEB-INF/classes/mv/srv/ftp/casLoginView.jsp/usr/local/tomcat/webapps/cas/WEB-INF/view/jsp/default/ui/

这个时候就利用CAS实现了记住我的功能

感谢各位的阅读,以上就是“CAS怎么配置RememberMe”的内容了,经过本文的学习后,相信大家对CAS怎么配置RememberMe这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是编程之家,小编将为大家推送更多相关知识点的文章,欢迎关注!

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐