开发者

CAS, Spring Security and unprotected pages

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 -开发者_如何学JAVA 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


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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜