-
Sep 7th, 2012, 09:48 AM
#1
Security Authorities/Roles list comes as empty on anonymous login . Why?
Hello,
I'm a newbie to Spring Security. Here's a problem I ran across:
Within my welcome/login jsp page I'm printing out the current role of the user (anonymous guest) who just got to this page:
<security:authentication property="authorities" var="authorities" />
<ul> <c:forEach items="${authorities}" var="authority">
<li>${authority.authority}</li>
</c:forEach>
</ul>
When I start my browser fresh (i.e. with all the cookies/browsing history cleaned up) the list correctly contains ROLE_GUEST item. However, when I access page for the second (and subsequent) times - the list comes as empty.
Can anyone explain why?
Thank you so much,
Dima
-
Sep 7th, 2012, 10:53 AM
#2
Are you utilizing security=none or filters=none? If so, Spring Security will not be enabled for those URLs and thus there will be no GrantedAuthorities.
-
Sep 11th, 2012, 10:38 AM
#3
Rob,
Thank you so much, that was it!
Dima
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules