我希望在JSF/Primefaces应用程序中实现简单的身份验证。我尝试了很多不同的方法,例如对话框 - 登录演示在对话框上进行简单的测试,但它没有登录用户。
我还查看了Java安全性,例如:
我还查看了Java安全性,例如:
<security-constraint>
<web-resource-collection>
<web-resource-name>Protected Area</web-resource-name>
<url-pattern>/protected/*</url-pattern>
<http-method>PUT</http-method>
<http-method>DELETE</http-method>
<http-method>GET</http-method>
<http-method>POST</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>REGISTERED_USER</role-name>
</auth-constraint>
</security-constraint>
使用这个方法可以保护/protected目录下的所有内容,但据我了解,需要在服务器上定义一个领域来进行身份验证。我不想在服务器上指定它,只想在数据库中进行简单的查找。
有没有一种方法可以在不在应用程序服务器中定义任何内容的情况下对用户进行身份验证?或者其他简单的解决方案来验证和保护不同的页面?