
Originally Posted by
mpr
Hi marckun,
in my trial application I can only reproduce your problem when I do not allow a session to be created.
In this case I see the text "Your login attempt ..." after an unsuccessful login, but not the reason and the last entered username because there is no session to store SPRING_SECURITY_LAST_EXCEPTION.
You have published your index.jsp, but it also includes the file /common/taglib.jsp.
Do you use
Code:
%@ page session="false" %>
in this file ?
This could explain your problem.
Martin
Hello,
This is my taglib.jsp. I didnt put <%@ page session = "false" %> in it.
PHP Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" errorPage="/404.jsp" %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib uri="http://www.springframework.org/security/tags" prefix="security" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
In my console I have these logs:
PHP Code:
09:16:34,140 DEBUG XmlWebApplicationContext:272 - Publishing event in context [org.springframework.web.context.support.XmlWebApplicationContext@f39b3a]: org.springframework.security.event.authentication.AuthenticationFailureBadCredentialsEvent[source=org.springframework.security.providers.UsernamePasswordAuthenticationToken@c147d212: Principal: sdfsfsdf; Password: [PROTECTED]; Authenticated: false; Details: org.springframework.security.ui.WebAuthenticationDetails@0: RemoteIpAddress: 0:0:0:0:0:0:0:1; SessionId: F14EF0C8A055A47432621FC5302D636F; Not granted any authorities]
09:16:34,141 DEBUG AuthenticationProcessingFilter:405 - Updated SecurityContextHolder to contain null Authentication
09:16:34,142 DEBUG AuthenticationProcessingFilter:411 - Authentication request failed: org.springframework.security.BadCredentialsException: Bad credentials
09:16:34,143 DEBUG PersistentTokenBasedRememberMeServices:187 - Interactive login attempt was unsuccessful.
09:16:34,143 DEBUG PersistentTokenBasedRememberMeServices:273 - Cancelling cookie
09:16:34,145 DEBUG HttpSessionContextIntegrationFilter:255 - SecurityContextHolder now cleared, as request processing completed
09:16:34,149 DEBUG FilterChainProxy:205 - Converted URL to lowercase, from: '/index.jsp'; to: '/index.jsp'
09:16:34,149 DEBUG FilterChainProxy:212 - Candidate is: '/index.jsp'; pattern is /index.jsp; matched=true
09:16:34,149 DEBUG FilterChainProxy:165 - has an empty filter list
09:16:34,149 DEBUG JspServlet:248 - JspEngine --> /index.jsp
09:16:34,150 DEBUG JspServlet:249 - ServletPath: /index.jsp
09:16:34,150 DEBUG JspServlet:250 - PathInfo: null
09:16:34,150 DEBUG JspServlet:251 - RealPath: C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\project\index.jsp
09:16:34,150 DEBUG JspServlet:252 - RequestURI: /project/index.jsp
09:16:34,150 DEBUG JspServlet:253 - QueryString: error=true
09:16:34,150 DEBUG JspServlet:254 - Request Params:
09:16:34,151 DEBUG JspServlet:258 - error = true
09:17:21,441 DEBUG ManagerBase:677 - Start expire sessions StandardManager at 1247534241441 sessioncount 1
09:17:21,441 DEBUG ManagerBase:685 - End expire sessions StandardManager processingTime 0 expired sessions: 0
09:18:21,468 DEBUG ManagerBase:677 - Start expire sessions StandardManager at 1247534301468 sessioncount 1
09:18:21,469 DEBUG ManagerBase:685 - End expire sessions StandardManager processingTime 1 expired sessions: 0
09:16:34,140 DEBUG XmlWebApplicationContext:272 - Publishing event in context [org.springframework.web.context.support.XmlWebAppl icationContext@f39b3a]: org.springframework.security.event.authentication. AuthenticationFailureBadCredentialsEvent[source=org.springframework.security.providers.User namePasswordAuthenticationToken@c147d212: Principal: sdfsfsdf; Password: [PROTECTED]; Authenticated: false; Details: org.springframework.security.ui.WebAuthenticationD etails@0: RemoteIpAddress: 0:0:0:0:0:0:0:1; SessionId: F14EF0C8A055A47432621FC5302D636F; Not granted any authorities]
09:16:34,141 DEBUG AuthenticationProcessingFilter:405 - Updated SecurityContextHolder to contain null Authentication
09:16:34,142 DEBUG AuthenticationProcessingFilter:411 - Authentication request failed: org.springframework.security.BadCredentialsExceptio n: Bad credentials
09:16:34,143 DEBUG PersistentTokenBasedRememberMeServices:187 - Interactive login attempt was unsuccessful.
09:16:34,143 DEBUG PersistentTokenBasedRememberMeServices:273 - Cancelling cookie
09:16:34,145 DEBUG HttpSessionContextIntegrationFilter:255 - SecurityContextHolder now cleared, as request processing completed
ohh and btw. i tried to put <c:out value="${param.error}" /> and <c:out value="${params.error}" /> to print the parameter of index.jsp?error=true in the page. all i get is the string "param.error" and "params.error" printed on the screen, not the value of "error" which is "true". I dont know if i am doing it right..
-marckun