如何在我的 Web 应用程序中进行身份验证? JSF2 +春天3 + GlassFish3 +休眠

发布于 2024-10-08 13:44:03 字数 340 浏览 1 评论 0原文

我正在为客户从头开始构建一个新的网络应用程序。

这些工具是 JSF2、PrimeFaces、Spring3、GlassFish3、Hibernate。

我有一个基本的网络应用程序运行良好。现在我必须进行身份验证。

我的第一个想法是组合一个登录表单,该表单设置会话变量,并使用阶段侦听器检查会话变量,并在变量无效或太旧时重定向到“注销”。但这听起来像是一次彻头彻尾的黑客攻击。

我用谷歌搜索过,但我真的不知道从哪里开始。在我的平台上的网络应用程序中进行身份验证的真正方法是什么?

任何人都可以帮忙,或者给我指出教程或相关文档吗?

非常感谢任何帮助,

rh

I'm building a new web app from scratch for a client.

The tools are JSF2, PrimeFaces, Spring3, GlassFish3, Hibernate.

I have a basic web app working fine. Now I have to put authentication in.

My first thought was to hack together a login form that sets a session variable and have a phase listener check for the session variable and redirect to "logged out" when the variable is invalid or too old. But that sounds like a total hack.

I've googled, but I don't really know where to start. What's the REAL way of doing authentication in my web app on my platform?

Can anyone help, or point me to a tutorial, or the relevant documentation?

Any help is greatly appreciated,

rh

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

魔法唧唧 2024-10-15 13:44:03

您想到的 PhaseListener 是 JSF 中的解决方案之一。另一个解决方案是 Spring 安全性。如果你没有考虑这些,你可以尝试 Servlet 过滤器

The phaselistener you thought about is one of the solution in JSF. Another solution is Spring security. If you are not thinking about any of these, you can try Servlet filter

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文