2011-07-14 70 views
3

我正在嘗試爲JBoss 5.1.0.GA上託管的基於Web的應用程序使用自定義JAAS身份驗證模塊。所以一切似乎都運行良好,直到用戶數量增加,會話(因此它認爲)開始混合。JBoss JAAS自定義登錄模塊

我使用自定義JAAS的原因是由於自定義身份驗證後端和需要傳遞密碼以進一步在應用程序中使用。

當我在servlet中調用request.getUserPrincipal時,我得到了一個類型爲SimplePrincipal的對象,而不是我的自定義主體。爲了讓用戶使用SecurityAssociation.getSubject().getPrincipals()並懷疑此時我收到了不正確的委託人。

什麼是實現自定義登錄模塊並在JBoss上檢索web層(Serlets)上的已登錄Principal的正確方法?

編輯: EJB層上存在的問題,https://issues.jboss.org/browse/EJBTHREE-1756

價:

  1. http://stuffthathappens.com/blog/2008/05/16/writing-a-custom-jaas-loginmodule/
  2. http://community.jboss.org/wiki/SecurityJAASLoginModule
  3. http://community.jboss.org/message/531986#531986
  4. http://download.oracle.com/javase/1.4.2/docs/guide/security/jaas/JAASLMDevGuide.html
  5. http://community.jboss.org/thread/44388
  6. http://docs.redhat.com/docs/en-US/JBoss_Enterprise_Application_Platform/5/pdf/Security_Guide/JBoss_Enterprise_Application_Platform-5-Security_Guide-en-US.pdf

回答

1

我不能用我的自定義主要的工作得到了LoginModule。我創建了一個Tomcat valve,它加密並將密碼推送到HttpSession。其他servlet將檢索並解密密碼。