如何将 JAAS 安全凭证传播到服务器端?
J2EE 应用程序实现将自动将凭证传播到 EJBContext。它只包含用户名而不包含密码,对吗?非 J2EE 系统的标准传播方式是什么?我需要用户/密码来登录服务器端的另一个系统(某种 SSO)。我可以将用户/密码放入 ThreadLocal 中。它有什么缺点吗?
ThreadLocal 将不起作用,因为身份验证和应用程序不是同一线程。我找到了一种方法,将自定义主体放入主题中并从应用程序端加载它。不确定这是否是支持 SSO 的正确方法,因为纯密码已设置为主题。
The J2EE Application implementation will propagate credential to EJBContext automatically. It only includes user name instead of password, right? What's the standard way to propagate for non-J2EE system? I need the user/password to login another system in server side (kind of SSO). I can put user/password into ThreadLocal. Any cons for it?
ThreadLocal won't work since authenticate and application are not same thread. I figured out one way that put customized principal into Subject and load it from application side. Not sure if it is right approach to support SSO since the plain password is set into subject.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了一种方法,将自定义主体放入主题中并从应用程序端加载它。不确定这是否是支持 SSO 的正确方法,因为纯密码已设置为主题。
I figured out one way that put customized principal into Subject and load it from application side. Not sure if it is right approach to support SSO since the plain password is set into subject.