Meu sistema de Login não esta esta funcionando corretamente. Infelizmente nenhuma exceção e lançada.
servlet:
<bean id="userDetailsService" class="br.com.esportsclub.security.ESCUserDetailsService"></bean>
<sec:http pattern="/resources/**" security="none"></sec:http>
<sec:http pattern="/login" security="none"></sec:http>
<sec:http pattern="/" security="none"></sec:http>
<sec:http pattern="/usuario/cadastro" security="none"></sec:http>
<sec:http use-expressions="true" auto-config="true">
<sec:intercept-url pattern="/**/adicionar" access="hasRole('ROLE_ADMIN')"/>
<sec:intercept-url pattern="/**" access="isAuthenticated()"/>
<sec:form-login login-page="/login"
default-target-url="/bemvindo" authentication-failure-url="/login"
username-parameter="username" password-parameter="password" />
<sec:logout logout-success-url="/login"
invalidate-session="true" />
<sec:csrf disabled="true" />
</sec:http>
<sec:authentication-manager>
<sec:authentication-provider
user-service-ref="userDetailsService">
<sec:password-encoder hash="bcrypt"></sec:password-encoder>
</sec:authentication-provider>
</sec:authentication-manager>
</beans>
homeController:
@Controller
@RequestMapping("/")
public class HomeController {
@RequestMapping(value = "/", method = RequestMethod.GET)
public String home(){
return "home.home.tiles";
}
@RequestMapping(value = "/login", method = RequestMethod.GET)
public String login() {
return "home.login.tiles";
}
@RequestMapping(value = "/bemvindo", method = RequestMethod.GET)
public String bemvindo(){
return "home.bemvindo.tiles";
}
}
login.jsp:
<form action="<c:url value='/j_spring_security_check' />" method="post">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label>Nome de usuário:</label> <input type="text" name="username"
class="form-control">
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label>Senha:</label> <input type="password" name="password"
class="form-control">
</div>
</div>
</div>
<input type="submit" value="Fazer login" class="btn btn-default" />
</form>
Projeto no GitHub: https://github.com/rafaelvicio/ESC