简体   繁体   English

JBoss JAAS 自定义登录模块

[英]JBoss JAAS custom Login Module

I'm trying to use a custom JAAS authentication module for a web based application hosted on JBoss 5.1.0.GA .我正在尝试为托管在JBoss 5.1.0.GA上的基于 web 的应用程序使用自定义JAAS身份验证模块。 So everything seems to be working fine, until the number of users increases and sessions (so it think) start getting mixed.所以一切似乎都运行良好,直到用户数量增加并且会话(所以它认为)开始变得混杂。

The reason i'm using the custom JAAS is because of a custom authentication backend and the need to pass back the password for futher usage in the application.我使用自定义 JAAS 的原因是因为自定义身份验证后端以及需要传回密码以便在应用程序中进一步使用。

When i call request.getUserPrincipal in servlets i get an object of type SimplePrincipal instead on my custom principal.当我在 servlets 中调用 request.getUserPrincipal 时,我在我的自定义主体上得到了 SimplePrincipal 类型的 object。 To get the user i'm using SecurityAssociation.getSubject().getPrincipals() and suspect that at this point i'm getting the incorrect principal.为了让用户使用SecurityAssociation.getSubject().getPrincipals()并怀疑此时我得到的主体不正确。

Whats the correct way to implement a customing login module and retrieving the loggedin Principal on the web layer(Serlets) on JBoss?在 JBoss 上的 web 层(Serlets)上实现自定义登录模块和检索登录主体的正确方法是什么?

EDIT: The problem exists on the EJB layer, https://issues.jboss.org/browse/EJBTHREE-1756编辑:问题存在于 EJB 层, https://issues.jboss.org/browse/EJBHREE-1756

Ref:参考:

  1. http://stuffthathappens.com/blog/2008/05/16/writing-a-custom-jaas-loginmodule/ http://stuffthathappens.com/blog/2008/05/16/writing-a-custom-jaas-loginmodule/
  2. http://community.jboss.org/wiki/SecurityJAASLoginModule http://community.jboss.org/wiki/SecurityJAASLoginModule
  3. http://community.jboss.org/message/531986#531986 http://community.jboss.org/message/531986#531986
  4. http://download.oracle.com/javase/1.4.2/docs/guide/security/jaas/JAASLMDevGuide.html http://download.oracle.com/javase/1.4.2/docs/guide/security/jaas/JAASLMDevGuide.html
  5. http://community.jboss.org/thread/44388 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 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

I couldn't get the LoginModule with my custom principal working.我无法让我的自定义主体正常工作的LoginModule I created a Tomcat valve that encrypts and pushes the password to the HttpSession .我创建了一个 Tomcat valve ,它加密并将密码推送到HttpSession Other servlets will retrieve and decrypt the password.其他 servlets 将检索和解密密码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM