<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    隨筆-295  評論-26  文章-1  trackbacks-0

    五?FAQ?

    5.1 FAQ

    1. Q: ? 能否脫離Spring框架來使用Acegi?
      A:? 雖然Acegi 沒有要求必須使用Spring Framework,但事實上Acegi很大程度上利用了Spring的IOC和AOP,很難脫離Spring的單獨使用。
    2. Q:? Acegi有對xfire的支持嗎?
      A: 有,詳見http://jira.codehaus.org/browse/XFIRE-389
    3. Q: 為何無論怎么設置都返回到登陸頁面無法成功登陸?
      A:? 檢查登陸頁面或登陸失敗頁面是否只有ROLE_ANONYMOUS權限

    5.2 Acegi 補習班

    要了解Acegi,首先要了解以下幾個重要概念:

    1. Authentication
      Authentication對象包含了principal, credentials 和 authorities(authorities要賦予給principal的),同時也可以包含一些附加的認證請求信息,如TCP/IP地址和Session id等。
    2. SecurityContextHolder
      SecurityContextHolder包含ThreadLocal私有屬性用于存取SecurityContext, SecurityContext包含Authentication私有屬性, 看以下一段程序


      public void getSecurityContextInformations() {
      ??SecurityContext sc = SecurityContextHolder.getContext();
      ??Authentication auth = sc.getAuthentication();
      ??Object principal = auth.getPrincipal();
      ??if (principal instanceof UserDetails) {
      ???//用戶密碼
      ???String password = ((UserDetails) principal).getPassword();
      ???//用戶名稱
      ???String username = ((UserDetails) principal).getUsername();
      ???//用戶權限
      ???GrantedAuthority[] authorities = ((UserDetails) principal).getAuthorities();
      ???for (int i = 0; i < authorities.length; i++) {
      ????String authority = authorities[i].getAuthority();
      ???}
      ??}
      ??Object details = auth.getDetails();
      ??if (details instanceof WebAuthenticationDetails) {
      ???//用戶session id
      ???String SessionId = ((WebAuthenticationDetails) details).getSessionId();
      ??}
      ?}
    3. AuthenticationManager
      通過Providers驗證在當前 ContextHolder中的Authentication對象是否合法。
    4. AccessDecissionManager
      經過投票機制來審批是否批準操作
    5. RunAsManager
      當執行某個操作時,RunAsManager可選擇性地替換Authentication對象
    6. Interceptors
      攔截器(如FilterSecurityInterceptor,JoinPoint,MethodSecurityInterceptor等)用于協調授權,認證等操作


    大盤預測 國富論
    posted on 2007-09-12 14:46 華夢行 閱讀(158) 評論(0)  編輯  收藏

    只有注冊用戶登錄后才能發表評論。


    網站導航:
     
    主站蜘蛛池模板: 亚洲国产精品专区在线观看 | 国产免费一区二区三区| 在线免费观看你懂的| 情侣视频精品免费的国产| 国产综合精品久久亚洲| 亚洲免费二区三区| 一级全免费视频播放| 亚洲黄色免费网站| 国产亚洲情侣一区二区无码AV| 亚洲成a人片在线观看中文!!! | 亚洲a级在线观看| 亚洲精品视频免费| 搡女人免费视频大全| 亚洲AV日韩精品久久久久| 免费福利资源站在线视频| 五月婷婷综合免费| 亚洲电影国产一区| 免费在线视频你懂的| 久久久亚洲精品无码| 国产精品白浆在线观看免费| 少妇亚洲免费精品| 亚洲一久久久久久久久| 91制片厂制作传媒免费版樱花| 亚洲综合精品香蕉久久网97| 乱淫片免费影院观看| 日韩精品福利片午夜免费观着| 亚洲精品无码不卡| 韩国免费a级作爱片无码| 国产免费久久精品| 99久久国产亚洲综合精品| 久草在视频免费福利| 亚洲av成人中文无码专区| 在线成人a毛片免费播放| 亚洲人成黄网在线观看| 噜噜嘿在线视频免费观看| 有色视频在线观看免费高清在线直播| 亚洲一区二区三区在线观看精品中文 | WWW国产亚洲精品久久麻豆| 一本岛高清v不卡免费一三区| 亚洲av乱码一区二区三区按摩| 久久亚洲国产成人影院网站|