voyent
renderedOnUserRole and spring security not working on anonymous  XML
Forum Index -> General Help
Author Message
salvatore82


Joined: 03/Mar/2011 08:40:57
Messages: 18
Offline


Hi all, I have this problem. I've been following the guide on icefaces + security integration posted here http://www.icesoft.org/wiki/display/ICE/Spring+Security+3.1.2+with+ICEFaces+3.1, no problem with configuration, it's working, but I have the last problem. If I login into my application with a user with role ROLE_USER I will see any of component with renderedOnUserRole = 'ROLE_USER'. But If I'm not authenticated user and I put renderedOnUserRole = 'ROLE_ANONYMOUS' I can't see this components. Can you explain me why it's not working?

When I load the paga as unauthenticated I see in my log this:

[DEBUG] org.springframework.security.web.authentication.AnonymousAuthenticationFilter: Populated SecurityContextHolder with anonymous token: 'org.springframework.security.authentication.AnonymousAuthenticationToken@9057bc48: Principal: anonymousUser; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@2cd90: RemoteIpAddress: 0:0:0:0:0:0:0:1; SessionId: CD50E6BA316568DFACDE6B75ABF28230; Granted Authorities: ROLE_ANONYMOUS'

Why ROLE_USER is matched and default spring ROLE_ANONYMOUS not?

I try to set anonymous in my security.xml

<anonymous granted-authority="ROLE_NO_LOGGED" username="not_logged_user"/>

the log change coerently but again renderOnUserRole = 'ROLE_NO_LOGGED' does not match.

Thanks in advance.
salvatore82


Joined: 03/Mar/2011 08:40:57
Messages: 18
Offline


anyone?
salvatore82


Joined: 03/Mar/2011 08:40:57
Messages: 18
Offline


solved by myself using spring security tag, an example for users who will need it (icefaces 3 - security 3):

<sec:authorize var="loggedIn" access="isAuthenticated()" />
<c:choose>
<c:when test="${loggedIn}">
Logged
</c:when>
<c:otherwise>
Not logged
</c:otherwise>
</c:choose>

Bye.
 
Forum Index -> General Help
Go to:   
Powered by JForum 2.1.7ice © JForum Team