0
votes

I'm using Spring Security + CAS in my website and there are some pages present different information in different login status.

For example, link: foo.com/index
anonymous user - common page layout + login elements
authenticated user - customized layout + logout elements

Since Spring Security does not support CAS gateway feature at this moment, is there any workaround to resolve this problem?

Thanks, Wilson

2

2 Answers

0
votes

If you are using jsps for your view you can use Spring Security's tag library to achieve this (Spring Security Docs - JSP Tag Libraries).

If the user is logged in just customize the login/logout elements and use a different style sheet to change layout.

This discussion may help: http://forum.springsource.org/archive/index.php/t-87737.html

0
votes

Spring Security tag library does not work for this situation. Logged in user will have the anonymous user role when in a non-secured page - so doing something like replacing the login link with logout link is not possible.

See: How to show logged in user details on non-secured JSP page after login via Spring Security and CAS? for a more detailed explanation of the problem.