<nuxeo.platform.version>${nuxeo.general.release}</nuxeo.platform.version>
<nuxeo.core.version>${nuxeo.general.release}</nuxeo.core.version>
<chemistry.opencmis.version.nx>0.12.0-NX2</chemistry.opencmis.version.nx>
- <spring.version>3.0.5.RELEASE</spring.version>
- <spring.security.version>3.0.5.RELEASE</spring.security.version>
+ <spring.version>4.3.1.RELEASE</spring.version>
+ <spring.security.version>4.1.0.RELEASE</spring.security.version>
</properties>
<distributionManagement>
<bean id="springSecurityFilterChain"
class="org.springframework.security.web.FilterChainProxy">
- <sec:filter-chain-map path-type="ant">
+ <sec:filter-chain-map request-matcher="ant">
<!-- Exclude the resource path to public items' content from AuthN and AuthZ. Let's us publish resources with anonymous access. -->
<sec:filter-chain pattern="/publicitems/*/*/content"
filters="none"/>
<bean id="securityContextPersistenceFilter"
class="org.springframework.security.web.context.SecurityContextPersistenceFilter">
- <property name='securityContextRepository'>
+ <constructor-arg>
<bean class='org.springframework.security.web.context.HttpSessionSecurityContextRepository'>
<property name='allowSessionCreation' value='true' />
</bean>
- </property>
+ </constructor-arg>
</bean>
<bean id="basicAuthenticationFilter"
class="org.springframework.security.web.authentication.www.BasicAuthenticationFilter">
- <property name="authenticationManager" ref="authenticationManager"/>
- <property name="authenticationEntryPoint" ref="basicAuthenticationEntryPoint"/>
+ <constructor-arg ref="authenticationManager"/>
+ <constructor-arg ref="basicAuthenticationEntryPoint"/>
</bean>
<bean id="basicAuthenticationEntryPoint"
<bean id="exTranslationFilter"
class="org.springframework.security.web.access.ExceptionTranslationFilter">
- <property name="authenticationEntryPoint" ref="basicAuthenticationEntryPoint"/>
+ <constructor-arg ref="basicAuthenticationEntryPoint"/>
</bean>
<sec:authentication-manager alias="authenticationManager">
- <sec:authentication-provider ref="jaasAuthenticationProvider" user-service-ref="userDetailsService"/>
+ <sec:authentication-provider ref="jaasAuthenticationProvider"/>
</sec:authentication-manager>
<bean id="jaasAuthenticationProvider"
<property name="accessDecisionManager" ref="httpRequestAccessDecisionManager"/>
<!--property name="securityMetadataSource" ref="cspaceMetadataSource"/-->
<property name="securityMetadataSource">
- <sec:filter-security-metadata-source>
+ <sec:filter-security-metadata-source use-expressions="false">
<sec:intercept-url pattern="/**" access="IS_AUTHENTICATED_REMEMBERED"/>
</sec:filter-security-metadata-source>
</property>
<bean id="httpRequestAccessDecisionManager"
class="org.springframework.security.access.vote.AffirmativeBased">
- <property name="allowIfAllAbstainDecisions" value="false"/>
- <property name="decisionVoters">
+ <constructor-arg>
<list>
<ref bean="roleVoter"/>
<ref bean="authenticatedVoter"/>
</list>
- </property>
+ </constructor-arg>
+ <property name="allowIfAllAbstainDecisions" value="false"/>
</bean>
<bean id="authenticatedVoter"
<version>${spring.security.version}</version>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-jdbc</artifactId>
+ <version>${spring.version}</version>
+ <scope>provided</scope>
+ </dependency>
</dependencies>
<build>
<version>${spring.version}</version>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ <version>${spring.version}</version>
+ <scope>provided</scope>
+ </dependency>
<dependency>
<groupId>aopalliance</groupId>
<artifactId>aopalliance</artifactId>
</dependency>
<!--dependency> <groupId>org.springframework</groupId> <artifactId>spring-tx</artifactId>
<version>${spring.version}</version> <scope>provided</scope> </dependency -->
+ <dependency>
+ <groupId>org.jboss.security</groupId>
+ <artifactId>jbosssx</artifactId>
+ <version>2.0.3.SP1</version>
+ <scope>provided</scope>
+ </dependency>
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
- <version>1.6.2</version>
+ <version>2.10.2</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
import org.hibernate.exception.ConstraintViolationException;
+import org.jboss.security.SimpleGroup;
+
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.GrantedAuthority;
-import org.springframework.security.core.authority.GrantedAuthorityImpl;
+import org.springframework.security.authentication.jaas.JaasGrantedAuthority;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.transaction.TransactionDefinition;
import org.springframework.transaction.TransactionStatus;
}
private void login() {
- //GrantedAuthority cspace_admin = new GrantedAuthorityImpl("ROLE_ADMINISTRATOR");
- GrantedAuthority spring_security_admin = new GrantedAuthorityImpl("ROLE_SPRING_ADMIN"); //NOTE: Must match with value in applicationContext-authorization-test.xml (aka SPRING_SECURITY_METADATA)
+ //GrantedAuthority cspace_admin = new JaasGrantedAuthority("ROLE_ADMINISTRATOR", new SimpleGroup("Role"));
+ GrantedAuthority spring_security_admin = new JaasGrantedAuthority("ROLE_SPRING_ADMIN", new SimpleGroup("Role")); //NOTE: Must match with value in applicationContext-authorization-test.xml (aka SPRING_SECURITY_METADATA)
HashSet<GrantedAuthority> gauths = new HashSet<GrantedAuthority>();
//gauths.add(cspace_admin);
gauths.add(spring_security_admin);
<bean id="aclAuthorizationStrategy" class="org.springframework.security.acls.domain.AclAuthorizationStrategyImpl">
<constructor-arg>
<list>
- <bean class="org.springframework.security.core.authority.GrantedAuthorityImpl">
- <constructor-arg value="ROLE_SPRING_ADMIN"/>
- </bean>
- <bean class="org.springframework.security.core.authority.GrantedAuthorityImpl">
- <constructor-arg value="ROLE_SPRING_ADMIN"/>
- </bean>
- <bean class="org.springframework.security.core.authority.GrantedAuthorityImpl">
+ <bean class="org.springframework.security.authentication.jaas.JaasGrantedAuthority">
<constructor-arg value="ROLE_SPRING_ADMIN"/>
+ <constructor-arg>
+ <bean class="org.jboss.security.SimpleGroup">
+ <constructor-arg value="Role"/>
+ </bean>
+ </constructor-arg>
</bean>
</list>
</constructor-arg>
<property name="cacheName" value="aclCache"/>
</bean>
</constructor-arg>
+ <constructor-arg>
+ <bean class="org.springframework.security.acls.domain.DefaultPermissionGrantingStrategy">
+ <constructor-arg>
+ <bean class="org.springframework.security.acls.domain.ConsoleAuditLogger"/>
+ </constructor-arg>
+ </bean>
+ </constructor-arg>
+ <constructor-arg ref="aclAuthorizationStrategy"/>
</bean>
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.collectionspace.services.authorization.spi.CSpaceAuthorizationProvider;
+import org.jboss.security.SimpleGroup;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.GrantedAuthority;
-import org.springframework.security.core.authority.GrantedAuthorityImpl;
+import org.springframework.security.authentication.jaas.JaasGrantedAuthority;
import org.springframework.security.core.context.SecurityContextHolder;
/**
public void login() {
String user = "SPRING_ADMIN";
String password = "SPRING_ADMIN";
- GrantedAuthority spring_security_admin = new GrantedAuthorityImpl("ROLE_SPRING_ADMIN"); //NOTE: Must match with value in applicationContext-authorization-test.xml (aka SPRING_SECURITY_METADATA)
+ GrantedAuthority spring_security_admin = new JaasGrantedAuthority("ROLE_SPRING_ADMIN", new SimpleGroup("Role")); //NOTE: Must match with value in applicationContext-authorization-test.xml (aka SPRING_SECURITY_METADATA)
HashSet<GrantedAuthority> gauths = new HashSet<GrantedAuthority>();
gauths.add(spring_security_admin);
Authentication authRequest = new UsernamePasswordAuthenticationToken(user, password, gauths);
<bean id="aclAuthorizationStrategy" class="org.springframework.security.acls.domain.AclAuthorizationStrategyImpl">
<constructor-arg>
<list>
- <bean class="org.springframework.security.core.authority.GrantedAuthorityImpl">
- <constructor-arg value="ROLE_SPRING_ADMIN"/>
- </bean>
- <bean class="org.springframework.security.core.authority.GrantedAuthorityImpl">
- <constructor-arg value="ROLE_SPRING_ADMIN"/>
- </bean>
- <bean class="org.springframework.security.core.authority.GrantedAuthorityImpl">
+ <bean class="org.springframework.security.authentication.jaas.JaasGrantedAuthority">
<constructor-arg value="ROLE_SPRING_ADMIN"/>
+ <constructor-arg>
+ <bean class="org.jboss.security.SimpleGroup">
+ <constructor-arg value="Role"/>
+ </bean>
+ </constructor-arg>
</bean>
</list>
</constructor-arg>
<property name="cacheName" value="aclCache"/>
</bean>
</constructor-arg>
+ <constructor-arg>
+ <bean class="org.springframework.security.acls.domain.DefaultPermissionGrantingStrategy">
+ <constructor-arg>
+ <bean class="org.springframework.security.acls.domain.ConsoleAuditLogger"/>
+ </constructor-arg>
+ </bean>
+ </constructor-arg>
+ <constructor-arg ref="aclAuthorizationStrategy"/>
</bean>
description="undeploy spring binaries from ${jee.server.cspace}">
<delete>
<fileset dir="${jee.server.cspace}/lib" includes="org.springframework.*.jar"/>
- <fileset dir="${jee.server.cspace}/lib" includes="spring-security*.jar"/>
+ <fileset dir="${jee.server.cspace}/lib" includes="spring-*.jar"/>
+ <fileset dir="${jee.server.cspace}/lib" includes="ehcache-*.jar"/>
</delete>
</target>
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
- <version>2.7.7</version> <!-- More recent version is 2.9.1 -->
+ <version>2.10.2</version>
</dependency>
<dependency>
<artifactId>servlet-api</artifactId>