Pessoal, estou tentando implementar JAAS na minha aplicação segundo esse tuto http://uaihebert.com/?p=56#comment-1458.
Porém quando eu tento fazer acesso as páginas que deveriam estar bloqueadas, consigo acessá-las normalmente.
Ainda não implementei a parte do Banco, porém apenas fazendo as configurações no web.xml, deveria estar bloqueando correto?
Segue as classes. A estrutura de páginas esta identica ao do tutorial, o qual achei bem interessante e estou usando em minha aplicação.
web.xml
[code]
<?xml version="1.0" encoding="UTF-8"?> CertificadoDigital javax.faces.DEFAULT_SUFFIX .xhtml State saving method: 'client' or 'server' (=default). See JSF Specification 2.5.2 javax.faces.STATE_SAVING_METHOD client javax.servlet.jsp.jstl.fmt.localizationContext resources.application com.sun.faces.config.ConfigureListener /index.html Faces Servlet javax.faces.webapp.FacesServlet 1 Faces Servlet /faces/* *.faces *.jsf<security-constraint>
<web-resource-collection>
<web-resource-name>Only admins</web-resource-name>
<url-pattern>/pages/protected/admin/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>ADMIN</role-name>
</auth-constraint>
</security-constraint>
<security-constraint>
<web-resource-collection>
<web-resource-name>Users and admins</web-resource-name>
<url-pattern>/pages/protected/user/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>ADMIN</role-name>
<role-name>USER</role-name>
</auth-constraint>
</security-constraint>
<!-- Validation By Form -->
<login-config>
<auth-method>FORM</auth-method>
<form-login-config>
<form-login-page>/pages/protected/public/login.xhtml</form-login-page>
<form-error-page>/pages/protected/public/mensagens/loginError.xhtml</form-error-page>
</form-login-config>
</login-config>
<!-- Allowed Roles -->
<security-role>
<role-name>ADMIN</role-name>
</security-role>
<security-role>
<role-name>USER</role-name>
</security-role>
<!-- Filter to get the user name and work with it -->
<filter>
<filter-name>LoginFilter</filter-name>
<filter-class>br.com.certificadosdigitais.filter.LoginFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>LoginFilter</filter-name>
<url-pattern>/pages/protected/*</url-pattern>
</filter-mapping>
[/code]
Algo de errado?