Skip to content

Instantly share code, notes, and snippets.

@joevartuli
Created August 24, 2012 23:02
Show Gist options
  • Save joevartuli/3456888 to your computer and use it in GitHub Desktop.
Save joevartuli/3456888 to your computer and use it in GitHub Desktop.
Spring Security Application Context Example
<security:http create-session="stateless" entry-point-ref="authenticationEntryPoint" authentication-manager-ref="authenticationManager">
<security:custom-filter ref="customRestFilter" position="BASIC_AUTH_FILTER" />
<security:intercept-url pattern="/**" access="ROLE_USER" />
</security:http>
<bean id="authenticationEntryPoint" class="org.springframework.security.web.authentication.www.BasicAuthenticationEntryPoint">
<property name="realmName" value="Not Authorized" />
</bean>
<bean id="customRestFilter" class="rest.demo.CustomRestSecurityFilter">
<constructor-arg name="authenticationManager" ref="authenticationManager" />
</bean>
<security:authentication-manager alias="authenticationManager">
<security:authentication-provider ref="restAuthenticationProvider" />
</security:authentication-manager>
<bean id="restAuthenticationProvider" class="rest.demo.RestAuthenticationProvider" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment