Last active
October 2, 2015 13:08
-
-
Save xdu/2248284 to your computer and use it in GitHub Desktop.
spring security basic configuration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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.xsd "> | |
<global-method-security pre-post-annotations="enabled" /> | |
<http> | |
<intercept-url pattern="/**" access="ROLE_USER" requires-channel="https"/> | |
<http-basic /> | |
<logout invalidate-session="true"/> | |
</http> | |
<authentication-manager> | |
<authentication-provider> | |
<user-service> | |
<user name="admin" password="admin" authorities="ROLE_USER" /> | |
</user-service> | |
</authentication-provider> | |
</authentication-manager> | |
</beans:beans> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<context-param> | |
<param-name>contextConfigLocation</param-name> | |
<param-value>classpath:context.xml classpath:security.xml</param-value> | |
</context-param> | |
<listener> | |
<listener-class>org.springframework.security.web.session.HttpSessionEventPublisher</listener-class> | |
</listener> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment