Rename root folders
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
|
||||
This Source Code Form is subject to the terms of the Mozilla Public
|
||||
License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
-->
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_2_0.xsd"
|
||||
version="2.0">
|
||||
|
||||
<persistence-unit-metadata>
|
||||
<persistence-unit-defaults>
|
||||
<entity-listeners>
|
||||
<entity-listener
|
||||
class="org.springframework.data.jpa.domain.support.AuditingEntityListener" />
|
||||
</entity-listeners>
|
||||
</persistence-unit-defaults>
|
||||
</persistence-unit-metadata>
|
||||
|
||||
</entity-mappings>
|
||||
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
|
||||
This Source Code Form is subject to the terms of the Mozilla Public
|
||||
License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
-->
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
<persistence version="2.0"
|
||||
xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
|
||||
|
||||
<persistence-unit name="jpa-pu" transaction-type="RESOURCE_LOCAL">
|
||||
<provider>org.hibernate.ejb.HibernatePersistence</provider>
|
||||
<properties>
|
||||
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLInnoDBDialect" />
|
||||
<property name="hibernate.jdbc.batch_size" value="100" />
|
||||
<property name="hibernate.order_inserts" value="true" />
|
||||
</properties>
|
||||
</persistence-unit>
|
||||
</persistence>
|
||||
@@ -0,0 +1,89 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
|
||||
This Source Code Form is subject to the terms of the Mozilla Public
|
||||
License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
-->
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
|
||||
xmlns:jpa="http://www.springframework.org/schema/data/jpa" xmlns:sec="http://www.springframework.org/schema/security"
|
||||
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:cache="http://www.springframework.org/schema/cache"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
|
||||
http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa.xsd
|
||||
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.2.xsd
|
||||
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
|
||||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
|
||||
http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache.xsd">
|
||||
|
||||
<sec:global-method-security
|
||||
pre-post-annotations="enabled" />
|
||||
|
||||
<tx:annotation-driven />
|
||||
|
||||
<context:component-scan
|
||||
base-package="org.mifosplatform.accounting.*,
|
||||
org.mifosplatform.commands.provider.*,
|
||||
org.mifosplatform.commands.handler.*,
|
||||
org.mifosplatform.commands.service.*,
|
||||
org.mifosplatform.commands.*,
|
||||
org.mifosplatform.audit.*,
|
||||
org.mifosplatform.infrastructure.*,
|
||||
org.mifosplatform.scheduledjobs.*,
|
||||
org.mifosplatform.organisation.*,
|
||||
org.mifosplatform.portfolio.loanaccount.*,
|
||||
org.mifosplatform.portfolio.savingsaccount.*,
|
||||
org.mifosplatform.portfolio.*,
|
||||
org.mifosplatform.useradministration.*,
|
||||
org.mifosplatform.mix.*,
|
||||
org.mifosplatform.template.*,
|
||||
org.mifosplatform.template.service.*,
|
||||
org.mifosplatform.useradministration.*,
|
||||
org.mifosplatform.batch">
|
||||
<context:exclude-filter expression="org.springframework.stereotype.Controller"
|
||||
type="annotation" />
|
||||
|
||||
<!-- We do NOT want all @Configuration "beans" to be auto-detected by ComponentScan,
|
||||
but we want to use / import them explicitly in Tests & Spring Boot applications,
|
||||
or other import in other @Configuration, so that we could have mutually exclusive ones.
|
||||
-->
|
||||
<context:exclude-filter expression="org.springframework.context.annotation.Configuration"
|
||||
type="annotation" />
|
||||
</context:component-scan>
|
||||
|
||||
<bean id="auditorAware"
|
||||
class="org.mifosplatform.infrastructure.core.domain.AuditorAwareImpl" />
|
||||
<jpa:auditing auditor-aware-ref="auditorAware" />
|
||||
|
||||
<jpa:repositories base-package="org.mifosplatform.commands.domain" />
|
||||
<jpa:repositories base-package="org.mifosplatform.infrastructure.*.domain" />
|
||||
<jpa:repositories base-package="org.mifosplatform.accounting.*.domain" />
|
||||
<jpa:repositories base-package="org.mifosplatform.useradministration.domain" />
|
||||
<jpa:repositories base-package="org.mifosplatform.organisation.*.domain" />
|
||||
<jpa:repositories base-package="org.mifosplatform.portfolio.*" />
|
||||
<jpa:repositories base-package="org.mifosplatform.mix.domain" />
|
||||
<jpa:repositories base-package="org.mifosplatform.scheduledjobs.domain" />
|
||||
<jpa:repositories base-package="org.mifosplatform.template.domain" />
|
||||
|
||||
<import resource="infrastructure.xml" />
|
||||
|
||||
<!-- do NOT <import resource="jndi.xml" /> here anymore;
|
||||
we'll manually import jndi.xml where we still need it (MifosServletWebApplicationInitializerConfiguration)
|
||||
-->
|
||||
|
||||
<import resource="securityContext.xml" />
|
||||
|
||||
<import resource="cache.xml" />
|
||||
|
||||
<bean id="applicationEventMulticaster" class="org.springframework.context.event.SimpleApplicationEventMulticaster">
|
||||
<property name="taskExecutor">
|
||||
<bean class="org.springframework.core.task.SimpleAsyncTaskExecutor"/>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<import resource="spmContext.xml"/>
|
||||
</beans>
|
||||
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
|
||||
This Source Code Form is subject to the terms of the Mozilla Public
|
||||
License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
-->
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
|
||||
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:p="http://www.springframework.org/schema/p"
|
||||
xmlns:cache="http://www.springframework.org/schema/cache"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
|
||||
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
|
||||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
|
||||
http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache.xsd">
|
||||
|
||||
<bean id="ehcacheManager" class="org.springframework.cache.ehcache.EhCacheCacheManager"
|
||||
p:cacheManager-ref="ehcacheInstance" />
|
||||
|
||||
<bean id="ehcacheInstance"
|
||||
class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean"
|
||||
p:configLocation="classpath:/META-INF/spring/ehcache.xml" p:shared="true" />
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
|
||||
This Source Code Form is subject to the terms of the Mozilla Public
|
||||
License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
-->
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="http://ehcache.org/ehcache.xsd">
|
||||
<defaultCache eternal="true" maxEntriesLocalHeap="100"
|
||||
overflowToDisk="false" />
|
||||
|
||||
<cache name="users" maxEntriesLocalHeap="10000" eternal="true"
|
||||
overflowToDisk="false" />
|
||||
<cache name="usersByUsername" maxEntriesLocalHeap="10000"
|
||||
eternal="true" overflowToDisk="false" />
|
||||
<cache name="tenantsById" maxEntriesLocalHeap="10000" eternal="true"
|
||||
overflowToDisk="false" />
|
||||
<cache name="offices" maxEntriesLocalHeap="10000" eternal="true"
|
||||
overflowToDisk="false" />
|
||||
<cache name="officesForDropdown" maxEntriesLocalHeap="10000"
|
||||
eternal="true" overflowToDisk="false" />
|
||||
<cache name="officesById" maxEntriesLocalHeap="10000" eternal="true"
|
||||
overflowToDisk="false" />
|
||||
<cache name="charges" maxEntriesLocalHeap="10000" eternal="true"
|
||||
overflowToDisk="false" />
|
||||
<cache name="funds" maxEntriesLocalHeap="10000" eternal="true"
|
||||
overflowToDisk="false" />
|
||||
<cache name="code_values" maxEntriesLocalHeap="10000" eternal="true"
|
||||
overflowToDisk="false" />
|
||||
<cache name="codes" maxEntriesLocalHeap="10000" eternal="true"
|
||||
overflowToDisk="false" />
|
||||
<cache name="hooks" maxEntriesLocalHeap="10000" eternal="true"
|
||||
overflowToDisk="false" />
|
||||
</ehcache>
|
||||
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
|
||||
This Source Code Form is subject to the terms of the Mozilla Public
|
||||
License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
-->
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jdbc="http://www.springframework.org/schema/jdbc"
|
||||
xmlns:jee="http://www.springframework.org/schema/jee"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
|
||||
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd">
|
||||
|
||||
<bean id="entityManagerFactory"
|
||||
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
|
||||
depends-on="tenantDatabaseUpgradeService">
|
||||
<property name="dataSource" ref="routingDataSource" />
|
||||
<property name="persistenceUnitName" value="jpa-pu" />
|
||||
<property name="jpaVendorAdapter">
|
||||
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
|
||||
<property name="database" value="MYSQL" />
|
||||
<property name="showSql" value="false" />
|
||||
<property name="generateDdl" value="false" />
|
||||
<property name="databasePlatform" value="org.hibernate.dialect.MySQLDialect" />
|
||||
</bean>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
|
||||
<property name="entityManagerFactory" ref="entityManagerFactory" />
|
||||
</bean>
|
||||
|
||||
<!-- Create instance of transaction template for programmatic transaction manipulation -->
|
||||
<bean id="txTemplate" class="org.springframework.transaction.support.TransactionTemplate">
|
||||
<property name="transactionManager" ref="transactionManager"></property>
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
|
||||
This Source Code Form is subject to the terms of the Mozilla Public
|
||||
License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
-->
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jdbc="http://www.springframework.org/schema/jdbc"
|
||||
xmlns:jee="http://www.springframework.org/schema/jee"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
|
||||
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd">
|
||||
|
||||
<!-- name here must match TestDataSourceConfiguration -->
|
||||
<jee:jndi-lookup jndi-name="java:comp/env/jdbc/mifosplatform-tenants"
|
||||
id="tenantDataSourceJndi" />
|
||||
</beans>
|
||||
@@ -0,0 +1,224 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
|
||||
This Source Code Form is subject to the terms of the Mozilla Public
|
||||
License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
-->
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
<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"
|
||||
xmlns:oauth="http://www.springframework.org/schema/security/oauth2"
|
||||
xsi:schemaLocation="
|
||||
http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
|
||||
http://www.springframework.org/schema/security/oauth2
|
||||
http://www.springframework.org/schema/security/spring-security-oauth2.xsd
|
||||
http://www.springframework.org/schema/security
|
||||
http://www.springframework.org/schema/security/spring-security-3.2.xsd">
|
||||
|
||||
<beans:beans profile="basicauth">
|
||||
<http create-session="stateless" use-expressions="true" pattern="/api/**"
|
||||
entry-point-ref="basicAuthenticationEntryPoint">
|
||||
<intercept-url pattern="/api/*/authentication" access="permitAll"
|
||||
method="POST" requires-channel="https" />
|
||||
<intercept-url pattern="/api/*/self/authentication" access="permitAll"
|
||||
method="POST" requires-channel="https" />
|
||||
<intercept-url pattern="/api/**" access="isFullyAuthenticated()"
|
||||
method="GET" requires-channel="https" />
|
||||
<intercept-url pattern="/api/**" access="isFullyAuthenticated()"
|
||||
method="POST" requires-channel="https" />
|
||||
<intercept-url pattern="/api/**" access="isFullyAuthenticated()"
|
||||
method="PUT" requires-channel="https" />
|
||||
<intercept-url pattern="/api/**" access="isFullyAuthenticated()"
|
||||
method="DELETE" requires-channel="https" />
|
||||
<intercept-url pattern="/api/**" access="isFullyAuthenticated()"
|
||||
method="HEAD" requires-channel="https" />
|
||||
|
||||
<custom-filter after="SECURITY_CONTEXT_FILTER"
|
||||
ref="basicAuthenticationProcessingFilter" />
|
||||
</http>
|
||||
|
||||
<beans:bean id="basicAuthenticationEntryPoint"
|
||||
class="org.springframework.security.web.authentication.www.BasicAuthenticationEntryPoint">
|
||||
<beans:property name="realmName" value="Mifos Platform API" />
|
||||
</beans:bean>
|
||||
|
||||
<beans:bean id="passwordEncoder"
|
||||
class="org.springframework.security.authentication.encoding.ShaPasswordEncoder">
|
||||
<beans:constructor-arg value="256" />
|
||||
</beans:bean>
|
||||
|
||||
<beans:bean id="saltSource"
|
||||
class="org.springframework.security.authentication.dao.ReflectionSaltSource">
|
||||
<beans:property name="userPropertyToUse" value="id" />
|
||||
</beans:bean>
|
||||
|
||||
<beans:bean id="customAuthenticationProvider"
|
||||
class="org.springframework.security.authentication.dao.DaoAuthenticationProvider">
|
||||
<beans:property name="userDetailsService" ref="userDetailsService" />
|
||||
<beans:property name="passwordEncoder" ref="passwordEncoder" />
|
||||
<beans:property name="saltSource" ref="saltSource" />
|
||||
</beans:bean>
|
||||
|
||||
<authentication-manager alias="authenticationManager"
|
||||
erase-credentials="false">
|
||||
<authentication-provider ref="customAuthenticationProvider" />
|
||||
</authentication-manager>
|
||||
</beans:beans>
|
||||
<beans:beans profile="oauth">
|
||||
<http create-session="stateless" use-expressions="true" pattern="/api/v1/**"
|
||||
entry-point-ref="oauthAuthenticationEntryPoint"
|
||||
access-decision-manager-ref="accessDecisionManager">
|
||||
<anonymous enabled="false" />
|
||||
<intercept-url pattern="/api//v1/**" method="OPTIONS"
|
||||
access="permitAll" requires-channel="https" />
|
||||
<intercept-url pattern="/api/v1/**" access="isFullyAuthenticated()"
|
||||
method="GET" requires-channel="https" />
|
||||
<intercept-url pattern="/api/v1/**" access="isFullyAuthenticated()"
|
||||
method="POST" requires-channel="https" />
|
||||
<intercept-url pattern="/api/v1/**" access="isFullyAuthenticated()"
|
||||
method="PUT" requires-channel="https" />
|
||||
<intercept-url pattern="/api/v1/**" access="isFullyAuthenticated()"
|
||||
method="DELETE" requires-channel="https" />
|
||||
<intercept-url pattern="/api/v1/**" access="isFullyAuthenticated()"
|
||||
method="HEAD" requires-channel="https" />
|
||||
<custom-filter ref="tenantIdentifierProcessingFilter"
|
||||
position="FIRST" />
|
||||
<custom-filter before="PRE_AUTH_FILTER" ref="resourceServerFilter" />
|
||||
<access-denied-handler ref="oauthAccessDeniedHandler" />
|
||||
</http>
|
||||
|
||||
<http pattern="/api/oauth/token" create-session="stateless"
|
||||
entry-point-ref="oauthAuthenticationEntryPoint" use-expressions="true"
|
||||
authentication-manager-ref="clientAuthenticationManager">
|
||||
<intercept-url pattern="/api/oauth/token" method="OPTIONS"
|
||||
access="permitAll" requires-channel="https" />
|
||||
<intercept-url pattern="/api/oauth/token" method="POST"
|
||||
access="isFullyAuthenticated()" requires-channel="https" />
|
||||
<anonymous enabled="false" />
|
||||
|
||||
<custom-filter ref="tenantIdentifierProcessingFilter"
|
||||
position="FIRST" />
|
||||
<custom-filter ref="clientCredentialsTokenEndpointFilter"
|
||||
before="BASIC_AUTH_FILTER" />
|
||||
<access-denied-handler ref="oauthAccessDeniedHandler" />
|
||||
</http>
|
||||
<beans:bean id="oauthAuthenticationEntryPoint"
|
||||
class="org.springframework.security.oauth2.provider.error.OAuth2AuthenticationEntryPoint">
|
||||
<beans:property name="realmName" value="Mifos Platform API" />
|
||||
</beans:bean>
|
||||
|
||||
<beans:bean id="oauthAccessDeniedHandler"
|
||||
class="org.springframework.security.oauth2.provider.error.OAuth2AccessDeniedHandler" />
|
||||
|
||||
|
||||
<beans:bean id="clientCredentialsTokenEndpointFilter"
|
||||
class="org.springframework.security.oauth2.provider.client.ClientCredentialsTokenEndpointFilter">
|
||||
<beans:constructor-arg value="/api/oauth/token" />
|
||||
<beans:property name="authenticationManager" ref="clientAuthenticationManager" />
|
||||
|
||||
</beans:bean>
|
||||
|
||||
<beans:bean id="accessDecisionManager"
|
||||
class="org.springframework.security.access.vote.UnanimousBased">
|
||||
<beans:constructor-arg>
|
||||
<beans:list>
|
||||
<beans:bean
|
||||
class="org.springframework.security.oauth2.provider.vote.ScopeVoter" />
|
||||
<beans:bean class="org.springframework.security.access.vote.RoleVoter" />
|
||||
<beans:bean
|
||||
class="org.springframework.security.access.vote.AuthenticatedVoter" />
|
||||
<beans:bean
|
||||
class="org.springframework.security.web.access.expression.WebExpressionVoter" />
|
||||
<beans:bean
|
||||
class="org.mifosplatform.infrastructure.security.vote.SelfServiceUserAccessVote" />
|
||||
</beans:list>
|
||||
</beans:constructor-arg>
|
||||
</beans:bean>
|
||||
|
||||
|
||||
<authentication-manager id="clientAuthenticationManager">
|
||||
<authentication-provider user-service-ref="clientDetailsUserService" />
|
||||
</authentication-manager>
|
||||
|
||||
<authentication-manager alias="authenticationManager"
|
||||
erase-credentials="false">
|
||||
<authentication-provider ref="customAuthenticationProvider" />
|
||||
</authentication-manager>
|
||||
|
||||
<beans:bean id="clientDetailsUserService"
|
||||
class="org.springframework.security.oauth2.provider.client.ClientDetailsUserDetailsService">
|
||||
<beans:constructor-arg ref="clientDetailsService" />
|
||||
</beans:bean>
|
||||
|
||||
|
||||
<beans:bean id="passwordEncoder"
|
||||
class="org.springframework.security.authentication.encoding.ShaPasswordEncoder">
|
||||
<beans:constructor-arg value="256" />
|
||||
</beans:bean>
|
||||
|
||||
<beans:bean id="saltSource"
|
||||
class="org.springframework.security.authentication.dao.ReflectionSaltSource">
|
||||
<beans:property name="userPropertyToUse" value="id" />
|
||||
</beans:bean>
|
||||
|
||||
<beans:bean id="customAuthenticationProvider"
|
||||
class="org.springframework.security.authentication.dao.DaoAuthenticationProvider">
|
||||
<beans:property name="userDetailsService" ref="userDetailsService" />
|
||||
<beans:property name="passwordEncoder" ref="passwordEncoder" />
|
||||
<beans:property name="saltSource" ref="saltSource" />
|
||||
</beans:bean>
|
||||
|
||||
|
||||
|
||||
<beans:bean id="clientDetailsService"
|
||||
class="org.springframework.security.oauth2.provider.client.JdbcClientDetailsService">
|
||||
<beans:constructor-arg ref="routingDataSource" />
|
||||
</beans:bean>
|
||||
|
||||
|
||||
<beans:bean id="tokenStore"
|
||||
class="org.springframework.security.oauth2.provider.token.store.JdbcTokenStore">
|
||||
<beans:constructor-arg ref="routingDataSource" />
|
||||
</beans:bean>
|
||||
|
||||
<beans:bean id="tokenServices"
|
||||
class="org.springframework.security.oauth2.provider.token.DefaultTokenServices">
|
||||
<beans:property name="tokenStore" ref="tokenStore" />
|
||||
<beans:property name="clientDetailsService" ref="clientDetailsService" />
|
||||
<beans:property name="supportRefreshToken" value="true" />
|
||||
<beans:property name="refreshTokenValiditySeconds"
|
||||
value="86400" />
|
||||
<beans:property name="accessTokenValiditySeconds"
|
||||
value="3600" />
|
||||
</beans:bean>
|
||||
|
||||
<beans:bean id="userApprovalHandler"
|
||||
class="org.springframework.security.oauth2.provider.approval.TokenStoreUserApprovalHandler">
|
||||
<beans:property name="tokenStore" ref="tokenStore" />
|
||||
<beans:property name="clientDetailsService" ref="clientDetailsService" />
|
||||
<beans:property name="requestFactory" ref="oAuth2RequestFactory" />
|
||||
</beans:bean>
|
||||
|
||||
<beans:bean id="oAuth2RequestFactory"
|
||||
class="org.springframework.security.oauth2.provider.request.DefaultOAuth2RequestFactory">
|
||||
<beans:constructor-arg ref="clientDetailsService" />
|
||||
</beans:bean>
|
||||
|
||||
<oauth:authorization-server
|
||||
client-details-service-ref="clientDetailsService" token-services-ref="tokenServices"
|
||||
user-approval-handler-ref="userApprovalHandler" token-endpoint-url="/api/oauth/token"
|
||||
authorization-endpoint-url="/api/oauth/authorize">
|
||||
<oauth:refresh-token />
|
||||
<oauth:password />
|
||||
</oauth:authorization-server>
|
||||
|
||||
<oauth:resource-server id="resourceServerFilter"
|
||||
token-services-ref="tokenServices" />
|
||||
</beans:beans>
|
||||
</beans:beans>
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
|
||||
This Source Code Form is subject to the terms of the Mozilla Public
|
||||
License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
-->
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:context="http://www.springframework.org/schema/context"
|
||||
xmlns:jpa="http://www.springframework.org/schema/data/jpa"
|
||||
xmlns:tx="http://www.springframework.org/schema/tx"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
|
||||
http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa.xsd
|
||||
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
|
||||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
|
||||
|
||||
<tx:annotation-driven />
|
||||
|
||||
<context:component-scan base-package="org.mifosplatform.spm"/>
|
||||
|
||||
<jpa:repositories base-package="org.mifosplatform.spm.repository"/>
|
||||
|
||||
</beans>
|
||||
Reference in New Issue
Block a user