Hallo,
I'm using Spring Security 3.1 and JSF 2 for the first time.
This is my login definition in spring-security.xml:
and my login.xhtml:Code:<http auto-config="true" access-denied-page="/login.xhtml"> <form-login login-page="/login.xhtml" default-target-url="/pages/main.xhtml" authentication-failure-url="/login.xhtml" /> <logout logout-url="/logout" invalidate-session="true" logout-success-url="/login.xhtml" /> </http>
A defined authentification provider isn't called after a submit in requiresAuthentication becauseCode:<?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui"> ... <h:form> <h:panelGrid columns="2" cellpadding="2"> <h:outputLabel for="#{loginBean.userName}" value="Username" /> <h:inputText id="j_username" value="#{loginBean.userName}" label="Username"></h:inputText> <h:outputLabel for="#{loginBean.password}" value="Password" /> <h:inputSecret id="j_password" value="#{loginBean.password}"></h:inputSecret> <div class="submit"> <button type="submit" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"> <span class="ui-button-text">Login</span> </button> </div> </h:panelGrid> </h:form> ... </html>
andCode:uri = "<webapp>/login.xhtml"
Set login-processing-url="/j_spring_security_check" or "/login.xhtml" in my form-login definition can't be a solution, because it generates a continuous-loop of AbstractProcesingFilter.requiresAuthentication() calls and an AuthenticationException in AbstractAuthenticationProcessingFilter before a login form is displayed for the first time?!Code:request.getContextPath() + filterProcessesUrl) = "<webapp>/j_spring_security_check"
Can someone help me? I'm looking for an running JSF 2 example (without any jsp pages)?!


Reply With Quote