← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3087: temporary fix for calling LoggedInAction. Also removed old spring security configuration.

 

------------------------------------------------------------
revno: 3087
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2011-03-19 20:00:32 +0100
message:
  temporary fix for calling LoggedInAction. Also removed old spring security configuration.
removed:
  dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/defaultDhisSecurity.xml
  dhis-2/dhis-web/dhis-web-commons/src/main/resources/META-INF/dhis/defaultDhisSecurity.xml
modified:
  dhis-2/dhis-web/dhis-web-commons/src/main/resources/META-INF/dhis/security.xml


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== removed file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/defaultDhisSecurity.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/defaultDhisSecurity.xml	2011-03-02 19:07:04 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/defaultDhisSecurity.xml	1970-01-01 00:00:00 +0000
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xmlns:aop="http://www.springframework.org/schema/aop";
-	xmlns:sec="http://www.springframework.org/schema/security";
-	xsi:schemaLocation="
-http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
-http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
-http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd
-">
-	<!-- Security -->
-	<bean id="org.hisp.dhis.security.PasswordManager" class="org.hisp.dhis.security.spring.SpringSecurityPasswordManager">
-		<property name="passwordEncoder" ref="passwordEncoder" />
-		<property name="usernameSaltSource" ref="usernameSaltSource" />
-	</bean>
-
-	<bean id="authenticationManager" class="org.springframework.security.authentication.ProviderManager">
-		<property name="providers" ref="daoAuthenticationProvider" />
-		<property name="authenticationEventPublisher" ref="defaultAuthenticationEventPublisher" />
-	</bean>
-
-	<bean id="defaultAuthenticationEventPublisher" class="org.springframework.security.authentication.DefaultAuthenticationEventPublisher" />
-
-	<bean id="daoAuthenticationProvider" class="org.springframework.security.authentication.dao.DaoAuthenticationProvider">
-		<property name="userDetailsService" ref="userDetailsService" />
-		<property name="passwordEncoder" ref="passwordEncoder" />
-		<property name="saltSource" ref="usernameSaltSource" />
-	</bean>
-
-	<bean id="userDetailsService" class="org.hisp.dhis.security.hibernate.HibernateUserDetailsService">
-		<property name="sessionFactory" ref="sessionFactory" />
-	</bean>
-
-	<bean id="passwordEncoder" class="org.springframework.security.authentication.encoding.Md5PasswordEncoder" />
-	<bean id="usernameSaltSource" class="org.hisp.dhis.security.DefaultUsernameSaltSource" />
-</beans>

=== removed file 'dhis-2/dhis-web/dhis-web-commons/src/main/resources/META-INF/dhis/defaultDhisSecurity.xml'
--- dhis-2/dhis-web/dhis-web-commons/src/main/resources/META-INF/dhis/defaultDhisSecurity.xml	2011-03-02 11:53:49 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/resources/META-INF/dhis/defaultDhisSecurity.xml	1970-01-01 00:00:00 +0000
@@ -1,244 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xmlns:sec="http://www.springframework.org/schema/security";
-	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";>
-
-	<!-- Security : Action -->
-	<bean id="org.hisp.dhis.security.action.LoggedInAction" class="org.hisp.dhis.security.action.LoggedInAction" scope="prototype">
-		<property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
-		<property name="selectionManager" ref="org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager" />
-		<property name="selectionTreeManager" ref="org.hisp.dhis.oust.manager.SelectionTreeManager" />
-	</bean>
-
-	<!-- Security : Filter -->
-	<bean id="filterChainProxy" class="org.springframework.security.web.FilterChainProxy">
-		<sec:filter-chain-map path-type="ant">
-			<sec:filter-chain pattern="/dhis-web-commons/security/**" filters="none" />
-			<sec:filter-chain pattern="/dhis-web-commons/javascripts/**" filters="none" />
-			<sec:filter-chain pattern="/dhis-web-commons/css/**" filters="none" />
-			<!-- <sec:filter-chain pattern="/api/**/*" filters="httpSessionContextIntegrationFilter,basicAuthenticationRequiredFilter"/> -->
-			<sec:filter-chain pattern="/api/**" filters="httpSessionContextIntegrationFilter,basicAuthenticationRequiredFilter" />
-			<sec:filter-chain pattern="/api" filters="httpSessionContextIntegrationFilter,basicAuthenticationRequiredFilter" />
-			<sec:filter-chain pattern="/**"
-				filters="httpSessionContextIntegrationFilter,authenticationProcessingFilter,logoutFilter,automaticAccessFilter,requiredLoginFilter" />
-		</sec:filter-chain-map>
-	</bean>
-
-	<bean id="httpSessionContextIntegrationFilter" class="org.springframework.security.web.context.HttpSessionContextIntegrationFilter" />
-
-	<bean id="authenticationProcessingFilter" class="org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter">
-		<property name="authenticationManager" ref="authenticationManager" />
-		<property name="authenticationFailureHandler" ref="failureHandler" />
-		<property name="authenticationSuccessHandler" ref="successHandler" />
-		<property name="filterProcessesUrl" value="/dhis-web-commons-security/login.action" />
-	</bean>
-
-	<bean id="successHandler" class="org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler">
-		<property name="defaultTargetUrl" value="/dhis-web-commons-security/loggedIn.action" />
-		<property name="alwaysUseDefaultTargetUrl" value="true" />
-	</bean>
-
-	<bean id="failureHandler" class="org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler">
-		<property name="defaultFailureUrl" value="/dhis-web-commons/security/loginfailed.html" />
-	</bean>
-
-	<bean id="logoutFilter" class="org.springframework.security.web.authentication.logout.LogoutFilter">
-		<constructor-arg value="/" />
-		<constructor-arg>
-			<list>
-				<ref bean="userAuditLogoutFilter" />
-				<bean class="org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler" />
-			</list>
-		</constructor-arg>
-		<property name="filterProcessesUrl" value="/dhis-web-commons-security/logout.action" />
-	</bean>
-
-	<bean id="userAuditLogoutFilter" class="org.hisp.dhis.security.filter.UserAuditLogoutFilter">
-		<property name="userAuditService" ref="org.hisp.dhis.useraudit.UserAuditService" />
-	</bean>
-
-	<bean id="automaticAccessFilter" class="org.hisp.dhis.security.filter.AutomaticAccessFilter">
-		<property name="accessProviders">
-			<map>
-				<entry key="databaseAdmin">
-					<ref bean="databaseAutomaticAccessProvider" />
-				</entry>
-				<entry key="ghostAdmin">
-					<ref bean="ghostAutomaticAccessProvider" />
-				</entry>
-			</map>
-		</property>
-	</bean>
-
-	<bean id="basicAuthenticationRequiredFilter" class="org.hisp.dhis.security.filter.BasicAuthenticationRequiredFilter">
-		<property name="authenticationManager" ref="authenticationManager" />
-		<property name="authenticationEntryPoint" ref="authenticationEntryPoint" />
-	</bean>
-
-	<bean id="authenticationEntryPoint" class="org.springframework.security.web.authentication.www.BasicAuthenticationEntryPoint">
-		<property name="realmName" value="DHIS2" />
-	</bean>
-
-	<bean id="requiredLoginFilter" class="org.hisp.dhis.security.filter.RequiredLoginFilter">
-		<property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
-		<property name="loginPageUrl" value="/dhis-web-commons/security/login.html" />
-	</bean>
-
-	<bean class="org.springframework.web.context.support.ServletContextAttributeExporter">
-		<property name="attributes">
-			<map>
-				<entry key="userAuditService">
-					<ref bean="org.hisp.dhis.useraudit.UserAuditService" />
-				</entry>
-				<entry key="userAuditStore">
-					<ref bean="org.hisp.dhis.useraudit.UserAuditStore" />
-				</entry>
-			</map>
-		</property>
-	</bean>
-
-	<!-- Security : Listener -->
-
-	<bean id="authenticationListener" class="org.hisp.dhis.security.listener.AuthenticationListener">
-		<property name="userAuditService" ref="org.hisp.dhis.useraudit.UserAuditService" />
-	</bean>
-
-	<!-- Security : AccessProvider -->
-
-	<bean id="databaseAutomaticAccessProvider" class="org.hisp.dhis.security.DatabaseAutomaticAccessProvider">
-		<property name="userService" ref="org.hisp.dhis.user.UserService" />
-		<property name="systemAuthoritiesProvider" ref="simpleSystemAuthoritiesProvider" />
-		<property name="passwordManager" ref="org.hisp.dhis.security.PasswordManager" />
-	</bean>
-
-	<bean id="ghostAutomaticAccessProvider" class="org.hisp.dhis.security.GhostAutomaticAccessProvider">
-		<property name="userService" ref="org.hisp.dhis.user.UserService" />
-		<property name="systemAuthoritiesProvider" ref="simpleSystemAuthoritiesProvider" />
-	</bean>
-
-	<!-- Security : AccessDecion/Voter -->
-
-	<bean id="accessDecisionManager" class="org.hisp.dhis.security.vote.LogicalOrAccessDecisionManager">
-		<property name="accessDecisionManagers">
-			<list>
-				<ref local="adminAccessDecisionVoting" />
-				<ref local="regularAccessDecisionVoting" />
-			</list>
-		</property>
-	</bean>
-
-	<bean id="regularAccessDecisionVoting" class="org.springframework.security.access.vote.UnanimousBased">
-		<property name="decisionVoters">
-			<list>
-				<ref local="actionAccessVoter" />
-				<ref local="moduleAccessVoter" />
-			</list>
-		</property>
-	</bean>
-
-	<bean id="actionAccessVoter" class="org.hisp.dhis.security.vote.ActionAccessVoter">
-		<property name="attributePrefix" value="F_" />
-	</bean>
-
-	<bean id="moduleAccessVoter" class="org.hisp.dhis.security.vote.ModuleAccessVoter">
-		<property name="attributePrefix" value="M_" />
-		<property name="alwaysAccessible">
-			<set>
-				<value>dhis-web-commons-menu</value>
-				<value>dhis-web-commons-oust</value>
-				<value>dhis-web-commons-ouwt</value>
-				<value>dhis-web-commons-security</value>
-				<value>dhis-web-commons-i18n</value>
-				<value>dhis-web-commons-ajax</value>
-				<value>dhis-web-commons-ajax-json</value>
-				<value>dhis-web-commons-help</value>
-				<value>dhis-web-commons-about</value>
-				<value>dhis-web-portal</value>
-			</set>
-		</property>
-	</bean>
-
-	<bean id="adminAccessDecisionVoting" class="org.springframework.security.access.vote.UnanimousBased">
-		<property name="decisionVoters">
-			<list>
-				<ref local="adminAccessVoter" />
-			</list>
-		</property>
-	</bean>
-
-	<bean id="adminAccessVoter" class="org.hisp.dhis.security.vote.SimpleAccessVoter">
-		<property name="requiredAuthority" value="ALL" />
-	</bean>
-
-	<bean id="org.hisp.dhis.security.ActionAccessResolver" class="org.hisp.dhis.security.SpringSecurityActionAccessResolver">
-		<property name="requiredAuthoritiesProvider" ref="org.hisp.dhis.security.authority.RequiredAuthoritiesProvider" />
-		<property name="accessDecisionManager" ref="accessDecisionManager" />
-	</bean>
-
-	<!-- Security : Interceptor -->
-
-	<bean id="org.hisp.dhis.security.intercept.XWorkSecurityInterceptor" class="org.hisp.dhis.security.intercept.XWorkSecurityInterceptor">
-		<property name="accessDecisionManager" ref="accessDecisionManager" />
-		<property name="authenticationManager" ref="authenticationManager" />
-		<property name="validateConfigAttributes" value="false" />
-		<property name="requiredAuthoritiesProvider" ref="org.hisp.dhis.security.authority.RequiredAuthoritiesProvider" />
-		<property name="actionAccessResolver" ref="org.hisp.dhis.security.ActionAccessResolver" />
-	</bean>
-
-	<!-- Security : AuthorityProvider -->
-
-	<bean id="org.hisp.dhis.security.authority.RequiredAuthoritiesProvider" class="org.hisp.dhis.security.authority.DefaultRequiredAuthoritiesProvider">
-		<property name="requiredAuthoritiesKey" value="requiredAuthorities" />
-		<property name="globalAttributes">
-			<set>
-				<value>M_MODULE_ACCESS_VOTER_ENABLED</value>
-			</set>
-		</property>
-	</bean>
-
-	<bean id="org.hisp.dhis.security.authority.SystemAuthoritiesProvider" class="org.hisp.dhis.security.authority.CachingSystemAuthoritiesProvider">
-		<property name="source" ref="compositeSystemAuthoritiesProvider" />
-	</bean>
-
-	<bean id="compositeSystemAuthoritiesProvider" class="org.hisp.dhis.security.authority.CompositeSystemAuthoritiesProvider">
-		<property name="sources">
-			<set>
-				<ref bean="detectingSystemAuthoritiesProvider" />
-				<ref bean="moduleSystemAuthoritiesProvider" />
-				<ref bean="simpleSystemAuthoritiesProvider" />
-			</set>
-		</property>
-	</bean>
-
-	<bean id="detectingSystemAuthoritiesProvider" class="org.hisp.dhis.security.authority.DetectingSystemAuthoritiesProvider">
-		<property name="requiredAuthoritiesProvider" ref="org.hisp.dhis.security.authority.RequiredAuthoritiesProvider" />
-	</bean>
-
-	<bean id="moduleSystemAuthoritiesProvider" class="org.hisp.dhis.security.authority.ModuleSystemAuthoritiesProvider">
-		<property name="authorityPrefix" value="M_" />
-		<property name="moduleManager" ref="org.hisp.dhis.webportal.module.ModuleManager" />
-		<property name="excludes">
-			<set>
-				<value>dhis-web-commons-menu</value>
-				<value>dhis-web-commons-oust</value>
-				<value>dhis-web-commons-ouwt</value>
-				<value>dhis-web-commons-security</value>
-				<value>dhis-web-commons-i18n</value>
-				<value>dhis-web-commons-ajax</value>
-				<value>dhis-web-commons-ajax-json</value>
-				<value>dhis-web-commons-help</value>
-				<value>dhis-web-commons-about</value>
-				<value>dhis-web-portal</value>
-			</set>
-		</property>
-	</bean>
-
-	<bean id="simpleSystemAuthoritiesProvider" class="org.hisp.dhis.security.authority.SimpleSystemAuthoritiesProvider">
-		<property name="authorities">
-			<set>
-				<value>ALL</value>
-			</set>
-		</property>
-	</bean>
-</beans>

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/resources/META-INF/dhis/security.xml'
--- dhis-2/dhis-web/dhis-web-commons/src/main/resources/META-INF/dhis/security.xml	2011-03-08 14:52:20 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/resources/META-INF/dhis/security.xml	2011-03-19 19:00:32 +0000
@@ -7,7 +7,7 @@
   <sec:global-method-security jsr250-annotations="disabled" pre-post-annotations="disabled" secured-annotations="disabled" />
 
   <sec:http access-decision-manager-ref="accessDecisionManager" use-expressions="true" realm="DHIS2">
-    <sec:form-login default-target-url="/dhis-web-portal/redirect.action" always-use-default-target="false"
+    <sec:form-login default-target-url="/dhis-web-commons-security/loggedIn.action" always-use-default-target="true"
       login-processing-url="/dhis-web-commons-security/login.action" authentication-failure-url="/dhis-web-commons/security/loginfailed.html"
       login-page="/dhis-web-commons/security/login.html" />
     <sec:http-basic />