溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

CAS怎么配置RememberMe

發(fā)布時間:2021-12-23 17:22:07 來源:億速云 閱讀:283 作者:iii 欄目:大數(shù)據(jù)

這篇文章主要講解了“CAS怎么配置RememberMe”,文中的講解內(nèi)容簡單清晰,易于學(xué)習(xí)與理解,下面請大家跟著小編的思路慢慢深入,一起來研究和學(xué)習(xí)“CAS怎么配置RememberMe”吧!

具體內(nèi)容

如果要想配置RememberMe的操作需要考慮到兩個配置部分:Shiro(WEB端)、CAS。1、修改applicationContext.xml文件,為其追加一個工廠類:

<!--如果要想實現(xiàn)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、此時對于記住我這個信息實際上還沒有提示內(nèi)容,所以需要修改一個資源文件:

·文件路徑: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、將各個文件拷貝到各個目標(biāo)位置上:

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實現(xiàn)了記住我的功能。

感謝各位的閱讀,以上就是“CAS怎么配置RememberMe”的內(nèi)容了,經(jīng)過本文的學(xué)習(xí)后,相信大家對CAS怎么配置RememberMe這一問題有了更深刻的體會,具體使用情況還需要大家實踐驗證。這里是億速云,小編將為大家推送更多相關(guān)知識點的文章,歡迎關(guān)注!

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI