Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="UTF-8"?>
- <beans:beans xmlns="http://www.springframework.org/schema/security"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/security
- http://www.springframework.org/schema/security/spring-security-3.2.xsd">
- <http auto-config="true">
- <intercept-url pattern="/restrito/admin/*" access="ROLE_ADMIN" />
- <intercept-url pattern="/restrito/basico/*" access="ROLE_BASICO" />
- <intercept-url pattern="/restrito/privilegiado/**"
- access="ROLE_PRIVILEGIADO" />
- <form-login login-page="/publico/login.jsf"
- authentication-failure-url="/publico/login.jsf?error=invalido"
- authentication-success-handler-ref="autenticacaoHandler" />
- </http>
- <authentication-manager>
- <authentication-provider>
- <jdbc-user-service data-source-ref="dataSource"
- users-by-username-query="SELECT email, senha, 'true' as enable FROM usuario WHERE email=?"
- authorities-by-username-query="SELECT senha, permissao FROM usuario WHERE email=?" />
- </authentication-provider>
- </authentication-manager>
- <beans:bean id="autenticacaoHandler" class="projetomb.util.AutenticacaoHandler" />
- <beans:bean id="dataSource"
- class="org.springframework.jdbc.datasource.DriverManagerDataSource">
- <beans:property name="url"
- value="jdbc:mysql://localhost:3306/meuprojeto" />
- <beans:property name="driverClassName" value="com.mysql.jdbc.Driver" />
- <beans:property name="username" value="root" />
- <beans:property name="password" value="123" />
- </beans:bean>
- </beans:beans>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement