<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> | |
<!-- | |
- Application context definition global to all servlet configurations. | |
--> | |
<beans> | |
<!-- ========================================================= | |
- JSecurity configuration | |
============================================================ --> | |
<!-- JSecurity post processor that automatically invokes init() and destroy() methods for | |
Spring-configured JSecurity objects so you don't have to 1) specify an init-method and destroy-method | |
attributes for every bean definition and 2) even know which JSecurity objects require these methods to be | |
called. --> | |
<bean class="org.jsecurity.spring.LifecycleBeanPostProcessor"/> | |
<!-- JSecurity's main business-tier object: --> | |
<bean id="securityManager" class="org.jsecurity.mgt.DefaultSecurityManager"> | |
<property name="realm" ref="activeDirectoryRealm"/> | |
</bean> | |
<!-- ========================================================= | |
- JDBC Realm - to use, inject jdbcRealm into the securityManager | |
============================================================ --> | |
<!-- JdbcRealm used to access sample database --> | |
<bean id="jdbcRealm" class="org.jsecurity.realm.jdbc.JdbcRealm"> | |
<property name="dataSource" ref="dataSource"/> | |
<property name="credentialsMatcher"> | |
<bean class="org.jsecurity.authc.credential.Sha1CredentialsMatcher"/> | |
</property> | |
</bean> | |
<!-- Data source used by sample app JdbcRealm --> | |
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> | |
<property name="driverClassName" value="org.hsqldb.jdbcDriver"/> | |
<property name="url" value="jdbc:hsqldb:mem:jsecurity-spring"/> | |
<property name="username" value="sa"/> | |
</bean> | |
<!-- Populates the sample database with sample users and roles. This would not exist in a real application --> | |
<bean id="bootstrapDataPopulator" class="org.jsecurity.samples.spring.BootstrapDataPopulator"> | |
<property name="dataSource" ref="dataSource"/> | |
</bean> | |
<!-- ========================================================= | |
- Property File Realm - to use, inject propertyFileRealm into the securityManager | |
============================================================ --> | |
<!--<bean id="propertyFileRealm" class="org.jsecurity.realm.text.PropertiesRealm"> | |
<property name="filePath" value="classpath:sample-users.properties"/> | |
</bean>--> | |
<!-- ========================================================= | |
- Active Directory Realm - to use, inject ldapRealm into the securityManager and update | |
- settings to match your active directory server, domain, etc. | |
============================================================ --> | |
<bean id="activeDirectoryRealm" class="org.jsecurity.realm.activedirectory.ActiveDirectoryRealm"> | |
<property name="principalSuffix" value="@Solad.local"/> | |
<property name="searchBase" value="OU=SolTech,DC=Solad,DC=local"/> | |
<property name="url" value="ldap://mail.soltech.net:389"/> | |
<property name="systemUsername" value="jhaile"/> | |
<property name="systemPassword" value="jha1le4"/> | |
</bean> | |
<!-- ========================================================= | |
- JSecurity annotation support | |
============================================================ --> | |
<!-- Enable JSecurity Annotations for Spring-configured beans: --> | |
<bean class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator"/> | |
<bean class="org.jsecurity.spring.security.interceptor.AuthorizationAttributeSourceAdvisor"> | |
<property name="securityManager" ref="securityManager"/> | |
</bean> | |
<!-- ========================================================= | |
- JSecurity Spring Remoting support | |
============================================================ --> | |
<!-- Ensure any Spring-based remote method invocations can be associated with a Subject and a Session --> | |
<bean id="secureRemoteInvocationExecutor" class="org.jsecurity.spring.remoting.SecureRemoteInvocationExecutor"> | |
<property name="securityManager" ref="securityManager"/> | |
</bean> | |
<!-- ========================================================= | |
- Sample App Objects | |
============================================================ --> | |
<!-- Sample application-level business Managers --> | |
<bean id="sampleManager" class="org.jsecurity.samples.spring.DefaultSampleManager"/> | |
</beans> |