【发布时间】:2012-12-14 16:26:41
【问题描述】:
我想在 JSF/Primefaces 应用程序中实现一个简单的身份验证。我尝试了很多不同的东西,例如Dialog - Login Demo 对一个对话框做了一个简单的测试,但它没有登录用户还是?
我也看过 Java Security,比如:
<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 下的所有内容都受到保护,但据我了解,我需要在服务器中定义一个领域以进行身份验证。我不想在服务器中指定它,而只是在数据库中进行简单的查找。
有没有一种方法可以在不定义应用程序服务器的情况下对用户进行身份验证?还是另一种简单的解决方案来验证和保护不同的页面?
【问题讨论】:
标签: java security jsf authentication jaspic