Re: [Acegisecurity-developer] SecurityContext authentication null in jsp / not null in controller

2009-10-16 Thread TheStijn

RESOLVED

the problem arose from the filter sequence.
The PageFilter (sitemesh) was invoked before the spring security filter and
because of this the security context was not yet available in the jsp.
Changing the order of the filters in web.xml (security filter first) fixed
the issue.

regards,
Stijn
-- 
View this message in context: 
http://www.nabble.com/SecurityContext-authentication-null-in-jsp---not-null-in-controller-tp25341903p25926974.html
Sent from the acegisecurity-developer mailing list archive at Nabble.com.


--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Home: http://acegisecurity.org
Acegisecurity-developer mailing list
Acegisecurity-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/acegisecurity-developer


[Acegisecurity-developer] SecurityContext authentication null in jsp / not null in controller

2009-09-08 Thread TheStijn

hi,

I've implemented spring security (2.0.3) using BasicAuthentication. This
seems to work fine. I'm however facing a strange problem when trying to use
the authentication tag to display the name of the user that logged in:
nothing is displayed. 
When debugging this tag I see that
SecurityContextHolder.getContext().getAuthentication() is null.

Also, following simply outputs null in the browser:
%= SecurityContextHolder.getContext().getAuthentication() %

So, it looked like maybe the authentication wasn't working as well as I
thought but if I debug a random controller and check the value of
SecurityContextHolder.getContext().getAuthentication() there, then it does
contain the expected principal.

Some of the possibly related information:

JSP

%@ taglib prefix=sec uri=http://www.springframework.org/security/tags;
%
...
sec:authentication property=principal.username/


Pom.xml
dependency
groupIdorg.springframework.security/groupId
artifactIdspring-security-taglibs/artifactId
version2.0.3/version
exclusions
exclusion
groupIdorg.springframework/groupId
artifactIdspring-context/artifactId
/exclusion
exclusion
groupIdorg.springframework/groupId
artifactIdspring-core/artifactId
/exclusion
exclusion
groupIdorg.springframework/groupId
artifactIdspring-aop/artifactId
/exclusion
exclusion
groupIdorg.springframework/groupId
artifactIdspring-support/artifactId
/exclusion
exclusion
groupIdorg.springframework.security/groupId
artifactIdspring-security-acl/artifactId
/exclusion
/exclusions
/dependency


I've attached the spring-security config: 
http://www.nabble.com/file/p25341903/talking-ccare-security.xml
talking-ccare-security.xml 

thanks for any help!

Stijn
-- 
View this message in context: 
http://www.nabble.com/SecurityContext-authentication-null-in-jsp---not-null-in-controller-tp25341903p25341903.html
Sent from the acegisecurity-developer mailing list archive at Nabble.com.


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Home: http://acegisecurity.org
Acegisecurity-developer mailing list
Acegisecurity-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/acegisecurity-developer