Skip to content

Instantly share code, notes, and snippets.

@lovuikeng
Created December 10, 2011 01:09
Show Gist options
  • Select an option

  • Save lovuikeng/1454126 to your computer and use it in GitHub Desktop.

Select an option

Save lovuikeng/1454126 to your computer and use it in GitHub Desktop.
Spring Security 3.1 added features
<!-- Single session with blocking of second attempt -->
<http>
<session-management>
<concurrency-control max-sessions="1" error-if-maximum-exceeded="true" />
</session-management>
</http>
<!-- Multiple http element with stateful and stateless support -->
<http pattern="/restful/**" create-session="stateless">
<intercept-url pattern='/**' access='ROLE_REMOTE' />
<http-basic />
</http>
<!-- Empty filter chain for the login page -->
<http pattern="/login.htm*" security="none"/>
<!-- Additional filter chain for normal users, matching all other requests -->
<http>
<intercept-url pattern='/**' access='ROLE_USER' />
<form-login login-page='/login.htm' default-target-url="/home.htm"/>
<logout />
</http>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment