JavaWorld@TW the best professional Java site in Taiwan
      註冊 | 登入 | 全文檢索 | 排行榜  

» JavaWorld@TW » Java Tools  

按列印兼容模式列印這個話題 列印話題    把這個話題寄給朋友 寄給朋友   
reply to topicthreaded modego to previous topicgo to next topic
己加入精華區
by jini at 2006-01-16 09:29
本主題所含的標籤
無標籤
作者 Jetspeed-2 心得隨筆(5)(完)-Security [精華]
wayyoung





發文: 21
積分: 1
於 2006-01-15 17:28 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
Jetspeed2 Security介紹的官方連結:
[url]http://portals.apache.org/jetspeed-2/multiproject/jetspeed-security/[url]

J2使用JAAS的來處理security有關的問題。以之前裝在Tomcat上的J2為例,可以由c:\tomcat\conf\Catalina\localhost\jetspeed.xml及C:\tomcat\webapps\jetspeed\WEB-INF\web.xml看到有關JAAS Realm及login的設定。

大致上來說,JAAS包含Principal、Permission、Policy三個概念。在J2中有user、role、group三種Principal。而Permission基本上有page、portlet,tab等等,當然也可以增加自訂的Permission。至於Policy,J2並沒有使用JAAS的policy檔,而是使用自帶的RdbmsPolicy,也就是把Policy的資訊存在資料庫中;而透過"適當"的實作和設定,J2也可以使用相關App Server的JAAS。

底下是官方的security元件架構圖:

在J2中,核心的部份就是"J2 Security Coarsed Services"裡的4個Manager元件。J2的JAAS login module實際上是使用UserManager來進行authentication;UserManager透過OJB自資料庫中取出user的資料例如UserPrincipal、Crendential等並進行authorization.

當透過UserManager認證完成以後,J2會同時將此User相對應的所有Principal取出並建立此User的Subject。此後,當SecurityValve執行時,就會呼叫JAAS的Subject.doAsPrivileged(Subject,PrivilegedAction,AccessControlContext)進行有關authorization的動作。有興趣的可以參考org.apache.jetspeed.security.impl.AbstractSecurityValve的原始碼。

J2在security的部份也提供了SPI的設計供開發人員加入自訂的認證方式,例如使用LDAP,參考底下官方的連結http://portals.apache.org/jetspeed-2/multiproject/jetspeed-security/ldap.html可以知道如何使用LDAP來進行J2上的認證。

關於J2,其實還有很多部份值得介紹,例如Bridge、Profiler等等。可惜這些部份小弟並不是十分的了解,期待日後有更多高手能夠對J2做更多的介紹,小弟在此先向大家跪謝啦!!Orz


vote up 0 vote down
wayyoung edited on 2006-01-16 10:58
reply to postreply to post
年輕的路,走自已的路

» JavaWorld@TW »  Java Tools

reply to topicthreaded modego to previous topicgo to next topic
  已讀文章
  新的文章
  被刪除的文章
Jump to the top of page

JavaWorld@TW


Powered by Powerful JuteForum® Version Jute 1.5.8
Copyright© 2002-2003 Rainman Zhu,Zua,Netboy,Scott. All Rights Reserved.