Hi,
I have the same configurations.
I have the loginbean as
Code:
public class LoginBean implements AuthenticationManager, Serializable{
private String username;
private String password;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public LoginBean() {
super();
}
public void reset(){
this.username = null;
this.password = null;
}
@Override
public Authentication authenticate(Authentication authentication)
throws AuthenticationException {
System.out.println("In auhenticate :" + username + ":" + password);
return authentication;
}
My login.xhtml is
Code:
<table border="0" width="100%">
<tr>
<td align="center" colspan="2"><img src="images/master_ui/logo.gif" /></td>
</tr>
<tr>
<td colspan="2" align="center">
<h:messages style="font-size: 10px; font-weight: bold;color: #E90649" id="messages"
layout="table" globalOnly="true"
showDetail="true" />
</td>
</tr>
<tr>
<td align="center">
<font color="#0000CC" face="Arial, Helvetica, sans-serif" size="1.5">User Name:</font>
</td>
<td>
<h:inputText id="j_username" value="#{loginBean.username}" size="20" maxlength="80"></h:inputText>
</td>
</tr>
<tr>
<td align="center">
<font color="#0000CC" face="Arial, Helvetica, sans-serif" size="1.5">Password: </font>
</td>
<td>
<h:inputSecret id="j_password"
value="#{loginBean.password}" size="20" maxlength="80"
redisplay="true" tabindex="0"></h:inputSecret>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<h:commandButton action="j_spring_security_check"
value="Login" tabindex="0"/>
<h:commandButton value="Reset" action="reset" tabindex="0"/>
</td>
</tr>
</table>
my login.xml is
Code:
<view-state id="login">
<transition on="authenticate" to="main" />
<transition on="reset" to=""/>
</view-state>
The authenticate action is not being called and the flow goes to main even though the authentication failed.
Any ideas??
Thanks
Vinaya