Skip to content

Instantly share code, notes, and snippets.

@maekl
Created December 21, 2016 15:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maekl/fc6d1b87cd6a4325c742025a42b70a46 to your computer and use it in GitHub Desktop.
Save maekl/fc6d1b87cd6a4325c742025a42b70a46 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/security" xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-3.0.3.xsd">
<!--
In this example two methods of authentication are supported and are tried in order
1. Basic Authentication
2. Authentication by providing credentials as request parameters
-->
<http create-session="never" realm="My Realm">
<http-basic/>
<custom-filter ref="parameter-auth-filter" after="BASIC_AUTH_FILTER"/>
<intercept-url pattern="/docs/**" access="" filters="none"/>
<intercept-url pattern="/**" access="ROLE_USER"/>
</http>
<authentication-manager alias="my-authentication-manager">
<authentication-provider user-service-ref="my-user-details-service"/>
</authentication-manager>
<beans:bean id="my-user-details-service" class="com.example.security.MyUserDetailsService"/>
<beans:bean id="parameter-auth-filter" class="com.example.security.RequestParameterAuthFilter">
<beans:property name="authenticationManager" ref="my-authentication-manager"/>
</beans:bean>
</beans:beans>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment