spring boot init

spring boot init
This commit is contained in:
shimingxy
2019-09-04 23:47:22 +08:00
parent 6181f5d657
commit fb15e2b070
1192 changed files with 2693 additions and 4070 deletions

View File

@@ -0,0 +1,121 @@
<?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:tx="http://www.springframework.org/schema/tx"
xmlns:jdbc="http://www.springframework.org/schema/jdbc"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/jdbc
http://www.springframework.org/schema/jdbc/spring-jdbc.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd">
<!-- dataSource define begin -->
<!-- c3p0 configuration -->
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close" >
<property name="driverClass" value="#{dataSoruceConfig.driverClass}"/>
<property name="jdbcUrl" value="#{dataSoruceConfig.url}"/>
<property name="user" value="#{dataSoruceConfig.username}"/>
<property name="password" value="#{dataSoruceConfig.password}"/>
</bean>
<!-- JNDI data source configuration -->
<!-- jndiName is jndi name -->
<!-- if you don,t want use prefix 'java:comp/env/' set resourceRef to true,default is false -->
<!--
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="jndi_maxkey_db" />
<property name="resourceRef" value="true" />
</bean> -->
<!-- dataSource define end -->
<bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
<property name="dataSource" ref="dataSource"></property>
</bean>
<!-- Declare a transaction manager -->
<!-- transaction manager, use JtaTransactionManager for global tx-->
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean>
<!-- Enable annotation style of managing transactions
<tx:annotation-driven transaction-manager="transactionManager" />-->
<!-- enable component scanning (beware that this does not enable mapper scanning!) -->
<context:component-scan base-package="org.maxkey.dao.service" />
<!-- enable autowire -->
<context:annotation-config />
<!-- enable transaction demarcation with annotations
<tx:annotation-driven />-->
<!--<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">-->
<bean id="sqlSessionFactory" class="org.apache.mybatis.jpa.MyBatisSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="transactionFactory">
<bean class="org.apache.ibatis.transaction.managed.ManagedTransactionFactory" />
</property>
<property name="typeAliasesPackage"
value="
org.maxkey.domain,
org.maxkey.domain.apps,
" />
<property name="timeout" value="30" />
<property name="mapperLocations" value="classpath*:org/maxkey/dao/persistence/xml/#{dataSoruceConfig.database}/*.xml" />
<property name="interceptors">
<list>
<ref bean="StatementHandlerInterceptor"/>
</list>
</property>
</bean>
<bean id="StatementHandlerInterceptor" class="org.apache.mybatis.jpa.StatementHandlerInterceptor">
<!-- dialect need bean dialect
<property name="dialect">
<bean id="dialect" class="org.apache.mybatis.jpa.dialect.MySQLDialect"/>
</property>
-->
<!-- from database type -->
<property name="dialectString" value="#{dataSoruceConfig.dialect}"/>
</bean>
<bean id="sqlSession" class="org.mybatis.spring.SqlSessionTemplate">
<constructor-arg index="0" ref="sqlSessionFactory" />
</bean>
<!-- scan for mappers and let them be autowired -->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage"
value="
org.maxkey.dao.persistence,
" />
</bean>
<bean id="redisConnectionFactory" class="org.maxkey.persistence.redis.RedisConnectionFactory">
<property name="hostname" value="${config.redis.hostname}"/>
<property name="port" value="${config.redis.port}"/>
<property name="timeOut" value="${config.redis.timeout}"/>
<property name="poolConfig" >
<bean class="redis.clients.jedis.JedisPoolConfig">
<property name="maxTotal" value="${config.redis.pool.maxtotal}" />
<property name="maxIdle" value="${config.redis.pool.maxidle}" />
<property name="maxWaitMillis" value="${config.redis.pool.maxwaitmillis}" />
<property name="testOnBorrow" value="${config.redis.pool.testonborrow}" />
</bean>
</property>
</bean>
</beans>

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8" ?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd">
<context:component-scan base-package="org.maxkey.authz.cas.endpoint" />
<bean id="casTicketServices" class="org.maxkey.authz.cas.endpoint.ticket.service.InMemoryTicketServices" />
<!--
<bean id="casTicketServices" class="org.maxkey.authz.cas.endpoint.ticket.service.RedisTicketServices" >
<property name="connectionFactory" ref="redisConnectionFactory"/>
</bean>
-->
</beans>

View File

@@ -0,0 +1,134 @@
<?xml version="1.0" encoding="UTF-8" ?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd">
<!-- oauth.provider-->
<context:component-scan base-package="org.maxkey.authz.oauth2.provider.endpoint" />
<!-- oauth.provider userinfo-->
<context:component-scan base-package="org.maxkey.authz.oauth2.provider.userinfo.endpoint" />
<context:component-scan base-package="org.maxkey.authz.oauth2.provider.approval.controller" />
<!-- OpenID Connect 1.0 -->
<!--
* Self-issued Provider Metadata
*
* http://openid.net/specs/openid-connect-core-1_0.html#SelfIssued
* -->
<bean id="oidcProviderMetadata" class="org.maxkey.config.oidc.OIDCProviderMetadataDetails">
<property name="issuer" value="${config.oidc.metadata.issuer}" />
<property name="authorizationEndpoint" value="${config.oidc.metadata.authorizationEndpoint}" />
<property name="tokenEndpoint" value="${config.oidc.metadata.tokenEndpoint}" />
<property name="userinfoEndpoint" value="${config.oidc.metadata.userinfoEndpoint}" />
</bean>
<bean id="tokenEnhancer" class="org.maxkey.authz.oidc.idtoken.OIDCIdTokenEnhancer">
<property name="providerMetadata" ref="oidcProviderMetadata" />
<property name="jwtSignerService" ref="jwtSignerValidationService" />
<property name="jwtEnDecryptionService" ref="jwtEncryptionService" />
<property name="clientDetailsService" ref="oauth20JdbcClientDetailsService" />
</bean>
<bean id="jwkSetKeyStore" class="org.maxkey.crypto.jose.keystore.JWKSetKeyStore">
<property name="location" value="classpath:config/keystore.jwks" />
</bean>
<bean id="jwtSignerValidationService" class="org.maxkey.crypto.jwt.signer.service.impl.DefaultJwtSigningAndValidationService">
<constructor-arg name="keyStore" ref="jwkSetKeyStore" />
<property name="defaultSignerKeyId" value="maxkey_rsa" />
<property name="defaultSigningAlgorithmName" value="RS256" />
</bean>
<bean id="jwtEncryptionService" class="org.maxkey.crypto.jwt.encryption.service.impl.DefaultJwtEncryptionAndDecryptionService">
<constructor-arg name="keyStore" ref="jwkSetKeyStore" />
<property name="defaultAlgorithm" value="RSA1_5" />
<property name="defaultDecryptionKeyId" value="maxkey_rsa" />
<property name="defaultEncryptionKeyId" value="maxkey_rsa" />
</bean>
<!--
<bean id="jwtLoginService" class="com.connsec.web.authentication.support.jwt.JwtLoginService">
<property name="jwtSignerValidationService" ref="jwtSignerValidationService" />
<property name="jwtProviderMetadata" ref="oidcProviderMetadata" />
</bean>
-->
<!-- OpenID Connect 1.0 End -->
<!-- In Memory -->
<bean id="oauth20AuthorizationCodeServices" class="org.maxkey.authz.oauth2.provider.code.InMemoryAuthorizationCodeServices">
</bean>
<bean id="oauth20TokenStore" class="org.maxkey.authz.oauth2.provider.token.store.InMemoryTokenStore" >
</bean>
<!-- Redis
<bean id="oauth20AuthorizationCodeServices" class="org.maxkey.authz.oauth2.provider.code.RedisAuthorizationCodeServices">
<constructor-arg ref="redisConnectionFactory" />
</bean>
<bean id="oauth20TokenStore" class="org.maxkey.authz.oauth2.provider.token.store.RedisTokenStore" >
<constructor-arg ref="redisConnectionFactory" />
</bean>
-->
<bean id="converter" class="org.maxkey.authz.oauth2.provider.token.store.JwtAccessTokenConverter">
</bean>
<bean id="oauth20JdbcClientDetailsService" class="org.maxkey.authz.oauth2.provider.client.JdbcClientDetailsService">
<constructor-arg ref="dataSource" />
<property name="passwordEncoder" ref="passwordReciprocal"></property>
</bean>
<bean id="oauth20ClientDetailsUserService" class="org.maxkey.authz.oauth2.provider.client.ClientDetailsUserDetailsService">
<constructor-arg ref="oauth20JdbcClientDetailsService" />
<property name="passwordEncoder" ref="passwordReciprocal"></property>
</bean>
<bean id="oauth20TokenServices" class="org.maxkey.authz.oauth2.provider.token.DefaultTokenServices">
<property name="tokenStore" ref="oauth20TokenStore"/>
<property name="supportRefreshToken" value="true" />
<property name="tokenEnhancer" ref="tokenEnhancer" />
<property name="clientDetailsService" ref="oauth20JdbcClientDetailsService" />
</bean>
<bean id="oauth20ApprovalStore" class="org.maxkey.authz.oauth2.provider.approval.TokenApprovalStore">
<property name="tokenStore" ref="oauth20TokenStore" />
</bean>
<bean id="oAuth2RequestFactory" class="org.maxkey.authz.oauth2.provider.request.DefaultOAuth2RequestFactory">
<constructor-arg name="clientDetailsService" ref="oauth20JdbcClientDetailsService" />
</bean>
<bean id="oauth20UserApprovalHandler" class="org.maxkey.authz.oauth2.provider.approval.controller.OAuth20UserApprovalHandler">
<property name="approvalStore" ref="oauth20ApprovalStore" />
<property name="clientDetailsService" ref="oauth20JdbcClientDetailsService"/>
<property name="requestFactory" ref="oAuth2RequestFactory" />
</bean>
<bean id="oauth20ClientAuthenticationManager" class="org.springframework.security.authentication.ProviderManager">
<constructor-arg>
<list>
<bean class="org.springframework.security.authentication.dao.DaoAuthenticationProvider">
<property name="passwordEncoder">
<bean class="org.springframework.security.crypto.password.NoOpPasswordEncoder "/>
</property>
<property name="userDetailsService" ref="oauth20ClientDetailsUserService"></property>
</bean>
</list>
</constructor-arg>
</bean>
</beans>

View File

@@ -0,0 +1,153 @@
<?xml version="1.0" encoding="UTF-8" ?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:sec="http://www.springframework.org/schema/security"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-3.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-3.1.xsd">
<!-- SAML V2.0 EndPoint -->
<context:component-scan base-package="org.maxkey.authz.saml20.provider.endpoint" />
<!-- MetaData V2.0 EndPoint -->
<context:component-scan base-package="org.maxkey.authz.saml20.metadata.endpoint" />
<bean id="samlBootstrapInitializer" class="org.opensaml.DefaultBootstrap" init-method="bootstrap"/>
<bean id="timeService" class="org.maxkey.authz.saml.service.TimeService" />
<bean id="idService" class="org.maxkey.authz.saml.service.IDService" />
<bean id="samlValidaotrSuite" class="org.maxkey.authz.saml20.xml.SAML2ValidatorSuite" />
<bean id="velocityEngine" class="org.springframework.ui.velocity.VelocityEngineFactoryBean">
<property name="preferFileSystemAccess" value="false"/>
<property name="velocityProperties">
<props>
<prop key="resource.loader">classpath</prop>
<prop key="classpath.resource.loader.class">org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader</prop>
</props>
</property>
</bean>
<bean id="mapBasedStorageService" class="org.opensaml.util.storage.MapBasedStorageService"/>
<bean id="samlParserPool" class="org.opensaml.xml.parse.BasicParserPool" >
<property name="maxPoolSize" value="${config.saml.v20.max.parser.pool.size}" />
</bean>
<bean id="OpenHTTPPostSimpleSignDecoder" class="org.maxkey.authz.saml20.OpenHTTPPostSimpleSignDecoder">
<constructor-arg ref="samlParserPool"/>
<property name="receiverEndpoint" value="${config.saml.v20.idp.receiver.endpoint}" />
</bean>
<bean id="openHTTPPostDecoder" class="org.maxkey.authz.saml20.OpenHTTPPostDecoder">
<constructor-arg ref="samlParserPool"/>
<property name="receiverEndpoint" value="${config.saml.v20.idp.receiver.endpoint}" />
</bean>
<bean id="openHTTPRedirectDecoder" class="org.maxkey.authz.saml20.OpenHTTPRedirectDecoder">
<constructor-arg ref="samlParserPool"/>
<property name="receiverEndpoint" value="${config.saml.v20.idp.receiver.endpoint}" />
</bean>
<bean id="issueInstantRule" class="org.opensaml.common.binding.security.IssueInstantRule">
<constructor-arg index="0" value="${config.saml.v20.issue.instant.check.clock.skew.in.seconds}"/>
<constructor-arg index="1" value="${config.saml.v20.issue.instant.check.validity.time.in.seconds}"/>
<property name="requiredRule" value="true"/>
</bean>
<bean id="replayCache" class="org.opensaml.util.storage.ReplayCache">
<constructor-arg ref="mapBasedStorageService"/>
<constructor-arg value="${config.saml.v20.replay.cache.life.in.millis}"></constructor-arg>
</bean>
<bean id="messageReplayRule" class="org.opensaml.common.binding.security.MessageReplayRule">
<constructor-arg ref="replayCache"/>
</bean>
<!-- ExtractPostBindingAdapter -->
<bean id="extractPostBindingAdapter" class="org.maxkey.authz.saml20.ExtractPostBindingAdapter">
<constructor-arg ref="openHTTPPostDecoder"/>
<property name="keyStoreLoader" ref="keyStoreLoader" />
<property name="issueInstantRule" ref="issueInstantRule" />
<property name="messageReplayRule" ref="messageReplayRule" />
</bean>
<!-- ExtractRedirectBindingAdapter -->
<bean id="extractRedirectBindingAdapter" class="org.maxkey.authz.saml20.ExtractRedirectBindingAdapter">
<constructor-arg ref="openHTTPRedirectDecoder"/>
<property name="keyStoreLoader" ref="keyStoreLoader" />
<property name="issueInstantRule" ref="issueInstantRule" />
<property name="messageReplayRule" ref="messageReplayRule" />
</bean>
<!-- PostBindingAdapter -->
<bean id="postSimpleSignBindingAdapter" class="org.maxkey.authz.saml20.PostSimpleSignBindingAdapter">
<property name="velocityEngine" ref="velocityEngine" />
<property name="issuerEntityName" value="${config.saml.v20.idp.issuer}"/>
</bean>
<!-- PostBindingAdapter -->
<bean id="postBindingAdapter" class="org.maxkey.authz.saml20.PostBindingAdapter">
<property name="velocityEngine" ref="velocityEngine" />
<property name="issuerEntityName" ref="issuerEntityName"/>
</bean>
<bean id="issuerEntityName" class="java.lang.String" >
<constructor-arg value="${config.saml.v20.idp.issuer}"/>
</bean>
<bean id="endpointGenerator" class="org.maxkey.authz.saml.common.EndpointGenerator"></bean>
<bean id="authnResponseGenerator" class="org.maxkey.authz.saml20.provider.xml.AuthnResponseGenerator">
<constructor-arg index="0" ref="issuerEntityName" />
<constructor-arg index="1" ref="timeService" />
<constructor-arg index="2" ref="idService" />
</bean>
<bean id="keyStoreLoader" class="org.maxkey.crypto.keystore.KeyStoreLoader">
<property name="entityName" value="${config.saml.v20.idp.issuing.entity.id}" />
<property name="keystorePassword" value="${config.saml.v20.idp.keystore.password}" />
<property name="keystoreFile" value="${config.saml.v20.idp.keystore}"/>
</bean>
<bean id="spKeyStoreLoader" class="org.maxkey.crypto.keystore.KeyStoreLoader">
<property name="entityName" value="${config.saml.v20.sp.issuing.entity.id}" />
<property name="keystorePassword" value="${config.saml.v20.sp.keystore.password}" />
<property name="keystoreFile" value="${config.saml.v20.sp.keystore}"/>
</bean>
<bean id="spIssuingEntityName" class="java.lang.String" >
<constructor-arg value="${config.saml.v20.sp.issuing.entity.id}"/>
</bean>
<bean id="saml20Metadata" class="org.maxkey.domain.Saml20Metadata">
<property name="orgName" value="${config.saml.v20.metadata.orgName}" />
<property name="orgDisplayName" value="${config.saml.v20.metadata.orgDisplayName}" />
<property name="orgURL" value="${config.saml.v20.metadata.orgURL}"/>
<property name="company" value="${config.saml.v20.metadata.company}" />
<property name="contactType" value="${config.saml.v20.metadata.contactType}" />
<property name="givenName" value="${config.saml.v20.metadata.givenName}"/>
<property name="surName" value="${config.saml.v20.metadata.surName}" />
<property name="emailAddress" value="${config.saml.v20.metadata.emailAddress}" />
<property name="telephoneNumber" value="${config.saml.v20.metadata.telephoneNumber}"/>
</bean>
</beans>

View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8" ?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd">
<!-- Single Sign On for application -->
<context:component-scan base-package="org.maxkey.authz.endpoint" />
<context:component-scan base-package="org.maxkey.authz.desktop.endpoint" />
<context:component-scan base-package="org.maxkey.authz.exapi.endpoint" />
<context:component-scan base-package="org.maxkey.authz.formbased.endpoint" />
<context:component-scan base-package="org.maxkey.authz.ltpa.endpoint" />
<context:component-scan base-package="org.maxkey.authz.token.endpoint" />
<import resource="maxkey-protocol-cas.xml"/>
<import resource="maxkey-protocol-saml.xml"/>
<import resource="maxkey-protocol-oauth2.0.xml"/>
</beans>

View File

@@ -0,0 +1,296 @@
<?xml version="1.0" encoding="UTF-8" ?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd">
<!--
<sec:http pattern="/jquery/**" security="none" />
<sec:http pattern="/images/**" security="none" />
<sec:http pattern="/css/**" security="none" />
<sec:http pattern="/js/**" security="none" />
<sec:http pattern="/metadata/saml20/**" security="none" />
<sec:http pattern="/api/oauth/v20/me" security="none" />
<sec:http pattern="/api/connect/v10/userinfo" security="none" />
cas api
<sec:http pattern="/authz/cas/validate" security="none" />
<sec:http pattern="/authz/cas/serviceValidate" security="none" />
<sec:http pattern="/authz/cas/proxyValidate" security="none" />
<sec:http pattern="/authz/cas/proxy" security="none" />
<sec:http pattern="/authz/cas/p3/serviceValidate" security="none" />
<sec:http pattern="/authz/cas/p3/proxyValidate" security="none" />
-->
<!-- enable autowire -->
<context:annotation-config />
<!-- language select must remove -->
<mvc:annotation-driven />
<!-- web Controller InterceptorAdapter -->
<mvc:interceptors>
<!-- web Controller InterceptorAdapter for platform permission -->
<mvc:interceptor>
<!-- for index -->
<mvc:mapping path="/index/*" />
<!-- for System -->
<mvc:mapping path="/menus/*" />
<mvc:mapping path="/roles/*" />
<mvc:mapping path="/logs/*" />
<mvc:mapping path="/userinfo/*" />
<mvc:mapping path="/relyingparty/*" />
<mvc:mapping path="/sysconfig/*" />
<mvc:mapping path="/roles/*"/>
<mvc:mapping path="/applications/*"/>
<mvc:mapping path="/approles/*"/>
<mvc:mapping path="/users/*" />
<mvc:mapping path="/enterprises/*" />
<mvc:mapping path="/employees/*" />
<mvc:mapping path="/authInfo/*" />
<mvc:mapping path="/usercenter/*"/>
<bean class="org.maxkey.web.interceptor.PermissionAdapter" />
</mvc:interceptor>
<!-- web Controller InterceptorAdapter for platform log -->
<mvc:interceptor>
<mvc:mapping path="/users/*" />
<mvc:mapping path="/userinfo/*" />
<mvc:mapping path="/enterprises/*" />
<mvc:mapping path="/employees/*" />
<mvc:mapping path="/authInfo/*" />
<mvc:mapping path="/usercenter/*"/>
<mvc:mapping path="/retrievePassword/*"/>
<mvc:mapping path="/roles/*"/>
<mvc:mapping path="/applications/*"/>
<mvc:mapping path="/approles/*"/>
<bean class="org.maxkey.web.interceptor.LogAdapter" />
</mvc:interceptor>
<!-- web Controller sso Adapter -->
<mvc:interceptor>
<mvc:mapping path="/authz/basic/*" />
<mvc:mapping path="/authz/ltpa/*" />
<mvc:mapping path="/authz/desktop/*" />
<mvc:mapping path="/authz/formbased/*" />
<mvc:mapping path="/authz/tokenbased/*"/>
<mvc:mapping path="/authz/saml20/idpinit/*"/>
<mvc:mapping path="/authz/cas/login"/>
<mvc:mapping path="/authz/cas/granting"/>
<bean class="org.maxkey.web.interceptor.PreLoginAppAdapter" />
</mvc:interceptor>
<!-- web Controller sso Adapter -->
<mvc:interceptor>
<mvc:mapping path="/authz/basic/*" />
<mvc:mapping path="/authz/ltpa/*" />
<mvc:mapping path="/authz/desktop/*" />
<mvc:mapping path="/authz/formbased/*" />
<mvc:mapping path="/authz/tokenbased/*"/>
<mvc:mapping path="/authz/saml20/idpinit/*"/>
<mvc:mapping path="/authz/cas/granting"/>
<bean class="org.maxkey.web.interceptor.LoginAppHistoryAdapter" />
</mvc:interceptor>
<ref bean="localeChangeInterceptor" />
</mvc:interceptors>
<bean id="remeberMeService" class="org.maxkey.authn.support.rememberme.JdbcRemeberMeService">
<constructor-arg ref="jdbcTemplate"/>
<property name="validity" value="${config.login.remeberme.validity}"/>
</bean>
<bean id="timeBasedKeyUriFormat" class="org.maxkey.crypto.password.opt.algorithm.KeyUriFormat">
<property name="type" value="totp" />
<property name="digits" value="6" />
<property name="issuer" value="ConnSec" />
<property name="domain" value="connsec.com" />
<property name="period" value="30" />
</bean>
<bean id="counterBasedKeyUriFormat" class="org.maxkey.crypto.password.opt.algorithm.KeyUriFormat">
<property name="type" value="hotp" />
<property name="digits" value="6" />
<property name="issuer" value="maxkey" />
<property name="domain" value="maxkey.org" />
<property name="counter" value="0" />
</bean>
<bean id="hotpKeyUriFormat" class="org.maxkey.crypto.password.opt.algorithm.KeyUriFormat">
<property name="type" value="hotp" />
<property name="digits" value="6" />
<property name="issuer" value="maxkey" />
<property name="domain" value="maxkey.org" />
<property name="counter" value="0" />
</bean>
<bean id="tfaOTPAuthn" class="org.maxkey.crypto.password.opt.impl.TimeBasedOTPAuthn">
<constructor-arg ref="jdbcTemplate" />
</bean>
<!-- Authentication Password Encoder Config -->
<bean id="passwordEncoder" class="org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder"></bean>
<bean id="passwordReciprocal" class="org.maxkey.crypto.password.PasswordReciprocal"></bean>
<bean id="cacheFactory" class="org.maxkey.cache.CacheFactory">
<property name="cache">
<list>
<bean class="org.maxkey.web.filter.ipaddress.IpAddressCache">
<property name="jdbcIpAddressService">
<bean class="org.maxkey.web.filter.ipaddress.JdbcIpAddressService">
<constructor-arg ref="jdbcTemplate"/>
</bean>
</property>
<property name="interval" value="1200" />
</bean>
</list>
</property>
</bean>
<!-- Captcha Producer Config -->
<bean id="captchaProducer" class="com.google.code.kaptcha.impl.DefaultKaptcha">
<property name="config">
<bean class="com.google.code.kaptcha.util.Config">
<constructor-arg type="java.util.Properties">
<props>
<prop key="kaptcha.image.width">70</prop>
<prop key="kaptcha.image.height">25</prop>
<prop key="kaptcha.border">no</prop>
<prop key="kaptcha.obscurificator.impl">com.google.code.kaptcha.impl.ShadowGimpy</prop>
<prop key="kaptcha.textproducer.font.size">23</prop>
<prop key="kaptcha.textproducer.char.string">0123456789</prop>
<prop key="kaptcha.textproducer.char.length">4</prop>
<prop key="kaptcha.noise.impl">com.google.code.kaptcha.impl.NoNoise</prop>
<!-- <prop key="kaptcha.noise.color">white</prop>
-->
</props>
</constructor-arg>
</bean>
</property>
</bean>
<!-- Follow is config for Spring security -->
<!--<csrf disabled="true"/>-->
<!-- Login
<http use-expressions="false" disable-url-rewriting="false" xmlns="http://www.springframework.org/schema/security" >
<headers>
<frame-options policy="SAMEORIGIN" />
</headers>
<access-denied-handler error-page="/login"/>
<intercept-url pattern="/index" access="ROLE_USER" />
<intercept-url pattern="/forwardindex" access="ROLE_USER" />
<intercept-url pattern="/**" access="IS_AUTHENTICATED_ANONYMOUSLY,ROLE_USER" />
<form-login authentication-failure-url="/login"
default-target-url="/forwardindex"
login-page="/login"
login-processing-url="/logon.do"
username-parameter="j_username"
password-parameter="j_password"
authentication-success-handler-ref="savedRequestSuccessHandler"/>
<logout logout-url="/logout.do" logout-success-url="/logout" invalidate-session="true" delete-cookies="JSESSIONID" />
<session-management invalid-session-url="/login" />
<anonymous />
</http>
-->
<bean id="savedRequestSuccessHandler" class="org.maxkey.authn.SavedRequestAwareAuthenticationSuccessHandler"> </bean>
<!-- spring authentication provider
<authentication-manager alias="authenticationProvider" xmlns="http://www.springframework.org/schema/security"/>
-->
<!-- LDAP Realm
<bean id="authenticationRealm" class="org.maxkey.web.authentication.realm.ldap.LdapAuthenticationRealm">
<constructor-arg ref="jdbcTemplate"/>
<property name="ldapServers">
<list>
<bean id="ldapServer1" class="org.maxkey.web.authentication.realm.ldap.LdapServer">
<property name="ldapUtils">
<bean id="ldapUtils" class="org.maxkey.ldap.LdapUtils">
<property name="providerUrl" value="ldap://localhost:389"></property>
<property name="principal" value="cn=root"></property>
<property name="credentials" value="rootroot"></property>
<property name="baseDN" value="dc=connsec,dc=com"></property>
</bean>
</property>
<property name="filterAttribute" value="uid"></property>
</bean>
</list>
</property>
</bean> -->
<!-- Active Directory Realm
<bean id="authenticationRealm" class="org.maxkey.web.authentication.realm.activedirectory.ActiveDirectoryAuthenticationRealm">
<constructor-arg ref="jdbcTemplate"/>
<property name="activeDirectoryServers">
<list>
<bean id="activeDirectory1" class="org.maxkey.web.authentication.realm.activedirectory.ActiveDirectoryServer">
<property name="activeDirectoryUtils">
<bean id="ldapUtils" class="org.maxkey.ldap.ActiveDirectoryUtils">
<property name="providerUrl" value="ldap://localhost:389"></property>
<property name="principal" value="cn=root"></property>
<property name="credentials" value="rootroot"></property>
<property name="domain" value="connsec"></property>
</bean>
</property>
</bean>
</list>
</property>
</bean> -->
<!-- Radius Server Realm
<bean id="authenticationRealm" class="org.maxkey.web.authentication.realm.radius.RadiusServerAuthenticationRealm">
<constructor-arg ref="jdbcTemplate"/>
<property name="jradiusServers">
<list>
<bean id="radiusServer1" class="org.maxkey.web.authentication.realm.radius.RadiusServer">
<property name="inetAddress" value="localhost"/>
<property name="secret" value="test1234"/>
</bean>
</list>
</property>
</bean>-->
<!-- Default Realm-->
<!-- realm use jdbc -->
<bean id="authenticationRealm" class="org.maxkey.authn.realm.jdbc.JdbcAuthenticationRealm">
<constructor-arg ref="jdbcTemplate"/>
</bean>
<!-- Authentication providers -->
<bean id="authenticationProvider" class="org.maxkey.authn.RealmAuthenticationProvider" >
</bean>
<!--
<authentication-manager alias="authenticationManager" xmlns="http://www.springframework.org/schema/security">
<authentication-provider ref= "realmAuthenticationProvider"/>
</authentication-manager>
-->
<mvc:annotation-driven />
<mvc:default-servlet-handler />
</beans>

View File

@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8" ?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:sec="http://www.springframework.org/schema/security"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security.xsd">
<!-- BASIC Support -->
<mvc:interceptors>
<mvc:interceptor>
<mvc:mapping path="/*" />
<bean class="org.maxkey.authn.support.basic.BasicEntryPoint" >
<property name="enable" value="${config.support.basic.enable}"></property>
</bean>
</mvc:interceptor>
</mvc:interceptors>
</beans>

View File

@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8" ?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:sec="http://www.springframework.org/schema/security"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security.xsd">
<bean id="httpHeaderSupport" class="org.maxkey.authn.support.httpheader.HttpHeaderConfig">
<property name="enable" value="${config.support.httpheader.enable}"></property>
<property name="headerName" value="${config.support.httpheader.headername}"></property>
</bean>
<!-- HttpHeader Support -->
<mvc:interceptors>
<mvc:interceptor>
<mvc:mapping path="/*" />
<bean class="org.maxkey.authn.support.httpheader.HttpHeaderEntryPoint" />
</mvc:interceptor>
</mvc:interceptors>
</beans>

View File

@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8" ?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd">
<!-- OpenID Connect 1.0 -->
<!--
* Self-issued Provider Metadata
*
* http://openid.net/specs/openid-connect-core-1_0.html#SelfIssued
* -->
<bean id="oidcProviderMetadata" class="org.maxkey.config.oidc.OIDCProviderMetadataDetails">
<property name="issuer" value="${config.oidc.metadata.issuer}" />
<property name="authorizationEndpoint" value="${config.oidc.metadata.authorizationEndpoint}" />
<property name="tokenEndpoint" value="${config.oidc.metadata.tokenEndpoint}" />
<property name="userinfoEndpoint" value="${config.oidc.metadata.userinfoEndpoint}" />
</bean>
<bean id="jwkSetKeyStore" class="org.maxkey.crypto.jose.keystore.JWKSetKeyStore">
<property name="location" value="classpath:config/keystore.jwks" />
</bean>
<bean id="jwtSignerValidationService" class="org.maxkey.crypto.jwt.signer.service.impl.DefaultJwtSigningAndValidationService">
<constructor-arg name="keyStore" ref="jwkSetKeyStore" />
<property name="defaultSignerKeyId" value="connsec_rsa" />
<property name="defaultSigningAlgorithmName" value="RS256" />
</bean>
<bean id="jwtEncryptionService" class="org.maxkey.crypto.jwt.encryption.service.impl.DefaultJwtEncryptionAndDecryptionService">
<constructor-arg name="keyStore" ref="jwkSetKeyStore" />
<property name="defaultAlgorithm" value="RSA1_5" />
<property name="defaultDecryptionKeyId" value="connsec_rsa" />
<property name="defaultEncryptionKeyId" value="connsec_rsa" />
</bean>
<bean id="jwtLoginService" class="org.maxkey.authn.support.jwt.JwtLoginService">
<property name="jwtSignerValidationService" ref="jwtSignerValidationService" />
<property name="jwtProviderMetadata" ref="oidcProviderMetadata" />
</bean>
</beans>

View File

@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd">
<bean id="kerberosService" class="org.maxkey.authn.support.kerberos.RemoteKerberosService">
<property name="kerberosProxys" >
<list>
<!-- default -->
<bean class="org.maxkey.authn.support.kerberos.KerberosProxy">
<property name="userdomain" value="${config.support.kerberos.default.userdomain}"/>
<property name="fullUserdomain" value="${config.support.kerberos.default.fulluserdomain}"/>
<property name="crypto" value="${config.support.kerberos.default.crypto}"/>
<property name="redirectUri" value="${config.support.kerberos.default.redirecturi}"/>
</bean>
</list>
</property>
</bean>
</beans>

View File

@@ -0,0 +1,122 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd">
<!-- Social Sign On Endpoint-->
<context:component-scan base-package="org.maxkey.web.authentication.support.socialsignon" />
<bean id="socialSignOnWeibo" class="org.maxkey.authn.support.socialsignon.service.SocialSignOnProvider">
<property name="provider" value="${config.socialsignon.sinaweibo.provider}"/>
<property name="providerName" value="${config.socialsignon.sinaweibo.provider.name}"/>
<property name="icon" value="${config.socialsignon.sinaweibo.icon}"/>
<property name="clientId" value="${config.socialsignon.sinaweibo.client.id}"/>
<property name="clientSecret" value="${config.socialsignon.sinaweibo.client.secret}"/>
<property name="authorizeUrl" value="${config.socialsignon.sinaweibo.authorize.url}"/>
<property name="accessTokenUrl" value="${config.socialsignon.sinaweibo.accesstoken.url}"/>
<property name="accessTokenMethod" value="${config.socialsignon.sinaweibo.accesstoken.method}"/>
<property name="scope" value="${config.socialsignon.sinaweibo.scope}"/>
<property name="verifierCode" value="${config.socialsignon.sinaweibo.verifier.code}"/>
<property name="accountUrl" value="${config.socialsignon.sinaweibo.account.url}"/>
<property name="accountId" value="${config.socialsignon.sinaweibo.account.id}"/>
<property name="sortOrder" value="${config.socialsignon.sinaweibo.sortorder}"/>
</bean>
<bean id="socialSignOnGoogle" class="org.maxkey.authn.support.socialsignon.service.SocialSignOnProvider">
<property name="provider" value="${config.socialsignon.google.provider}"/>
<property name="providerName" value="${config.socialsignon.google.provider.name}"/>
<property name="icon" value="${config.socialsignon.google.icon}"/>
<property name="clientId" value="${config.socialsignon.google.client.id}"/>
<property name="clientSecret" value="${config.socialsignon.google.client.secret}"/>
<property name="authorizeUrl" value="${config.socialsignon.google.authorize.url}"/>
<property name="accessTokenUrl" value="${config.socialsignon.google.accesstoken.url}"/>
<property name="accessTokenMethod" value="${config.socialsignon.google.accesstoken.method}"/>
<property name="scope" value="${config.socialsignon.google.scope}"/>
<property name="verifierCode" value="${config.socialsignon.google.verifier.code}"/>
<property name="accountUrl" value="${config.socialsignon.google.account.url}"/>
<property name="accountId" value="${config.socialsignon.google.account.id}"/>
<property name="sortOrder" value="${config.socialsignon.google.sortorder}"/>
</bean>
<bean id="socialSignOnQQ" class="org.maxkey.authn.support.socialsignon.service.SocialSignOnProvider">
<property name="provider" value="${config.socialsignon.qq.provider}"/>
<property name="providerName" value="${config.socialsignon.qq.provider.name}"/>
<property name="icon" value="${config.socialsignon.qq.icon}"/>
<property name="clientId" value="${config.socialsignon.qq.client.id}"/>
<property name="clientSecret" value="${config.socialsignon.qq.client.secret}"/>
<property name="authorizeUrl" value="${config.socialsignon.qq.authorize.url}"/>
<property name="accessTokenUrl" value="${config.socialsignon.qq.accesstoken.url}"/>
<property name="accessTokenMethod" value="${config.socialsignon.qq.accesstoken.method}"/>
<property name="scope" value="${config.socialsignon.qq.scope}"/>
<property name="verifierCode" value="${config.socialsignon.qq.verifier.code}"/>
<property name="accountUrl" value="${config.socialsignon.qq.account.url}"/>
<property name="accountId" value="${config.socialsignon.qq.account.id}"/>
<property name="sortOrder" value="${config.socialsignon.qq.sortorder}"/>
</bean>
<bean id="socialSignOnLive" class="org.maxkey.authn.support.socialsignon.service.SocialSignOnProvider">
<property name="provider" value="${config.socialsignon.live.provider}"/>
<property name="providerName" value="${config.socialsignon.live.provider.name}"/>
<property name="icon" value="${config.socialsignon.live.icon}"/>
<property name="clientId" value="${config.socialsignon.live.client.id}"/>
<property name="clientSecret" value="${config.socialsignon.live.client.secret}"/>
<property name="authorizeUrl" value="${config.socialsignon.live.authorize.url}"/>
<property name="accessTokenUrl" value="${config.socialsignon.live.accesstoken.url}"/>
<property name="accessTokenMethod" value="${config.socialsignon.live.accesstoken.method}"/>
<property name="scope" value="${config.socialsignon.live.scope}"/>
<property name="verifierCode" value="${config.socialsignon.live.verifier.code}"/>
<property name="accountUrl" value="${config.socialsignon.live.account.url}"/>
<property name="accountId" value="${config.socialsignon.live.account.id}"/>
<property name="sortOrder" value="${config.socialsignon.live.sortorder}"/>
</bean>
<bean id="socialSignOnFacebook" class="org.maxkey.authn.support.socialsignon.service.SocialSignOnProvider">
<property name="provider" value="${config.socialsignon.facebook.provider}"/>
<property name="providerName" value="${config.socialsignon.facebook.provider.name}"/>
<property name="icon" value="${config.socialsignon.facebook.icon}"/>
<property name="clientId" value="${config.socialsignon.facebook.client.id}"/>
<property name="clientSecret" value="${config.socialsignon.facebook.client.secret}"/>
<property name="authorizeUrl" value="${config.socialsignon.facebook.authorize.url}"/>
<property name="accessTokenUrl" value="${config.socialsignon.facebook.accesstoken.url}"/>
<property name="accessTokenMethod" value="${config.socialsignon.facebook.accesstoken.method}"/>
<property name="scope" value="${config.socialsignon.facebook.scope}"/>
<property name="verifierCode" value="${config.socialsignon.facebook.verifier.code}"/>
<property name="accountUrl" value="${config.socialsignon.facebook.account.url}"/>
<property name="accountId" value="${config.socialsignon.facebook.account.id}"/>
<property name="sortOrder" value="${config.socialsignon.facebook.sortorder}"/>
</bean>
<bean id="socialSignOnProviderService" class="org.maxkey.authn.support.socialsignon.service.SocialSignOnProviderService">
<property name="socialSignOnProviders" >
<list>
<ref bean="socialSignOnWeibo" />
<ref bean="socialSignOnQQ"/>
<ref bean="socialSignOnGoogle"/>
<ref bean="socialSignOnLive"/>
<ref bean="socialSignOnFacebook"/>
</list>
</property>
</bean>
<bean id="socialSignOnUserTokenService" class="org.maxkey.authn.support.socialsignon.service.JdbcSocialSignOnUserTokenService">
<constructor-arg ref="jdbcTemplate"/>
</bean>
</beans>

View File

@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8" ?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:sec="http://www.springframework.org/schema/security"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security.xsd">
<!-- WsFederation Support Start -->
<bean id="wsFederationConfiguration" class="org.maxkey.authn.support.wsfederation.WsFederationConfiguration">
<!--
#identifier: the identifer for the ADFS server
#url: the login url for ADFS
#principal: the name of the attribute/assertion returned by ADFS that contains the principal's username.
#relyingParty: the identifier of the CAS Server as it has been configured in ADFS.
#tolerance: (optional) the amount of drift to allow when validating the timestamp on the token. Default: 10000 (ms)
#attributeMutator: (optional) a class (defined by you) that can modify the attributes/assertions returned by the ADFS server
#signingCertificate: ADFS's signing certificate used to validate the token/assertions issued by ADFS.
-->
<property name="identifier" value="${config.support.wsfederation.identifier}" />
<property name="url" value="${config.support.wsfederation.url}" />
<property name="logoutUrl" value="${config.support.wsfederation.logoutUrl}" />
<property name="principal" value="${config.support.wsfederation.principal}" />
<property name="relyingParty" value="${config.support.wsfederation.relyingParty}" />
<property name="tolerance" value="${config.support.wsfederation.tolerance}" />
<property name="upnSuffix" value="${config.support.wsfederation.upn.suffix}" />
<property name="attributeMutator">
<bean class="org.maxkey.authn.support.wsfederation.WsFedAttributeMutatorImpl" />
</property>
<property name="signingCertificates">
<list>
<value>classpath:${config.support.wsfederation.signingCertificate}</value>
</list>
</property>
</bean>
<bean id="wsFederationService" class="org.maxkey.authn.support.wsfederation.WsFederationServiceImpl">
<property name="wsFederationConfiguration" ref="wsFederationConfiguration" />
</bean>
<!-- WsFederation Support End -->
</beans>

View File

@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8" ?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:sec="http://www.springframework.org/schema/security"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security.xsd">
<!-- Authentication -->
<import resource="maxkey-support-httpheader.xml"/>
<import resource="maxkey-support-basic.xml"/>
<import resource="maxkey-support-kerberos.xml"/>
<import resource="maxkey-support-social.xml"/>
<!--
<import resource="maxkey-support-wsfederation.xml"/>
<import resource="maxkey-support-jwt.xml"/>
-->
</beans>

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8" ?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:sec="http://www.springframework.org/schema/security"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security.xsd">
</beans>

View File

@@ -0,0 +1,118 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd">
<!-- Static resources -->
<!-- js images css -->
<mvc:resources mapping="/jquery/**" location="/jquery/" />
<mvc:resources mapping="/images/**" location="/images/" />
<mvc:resources mapping="/css/**" location="/css/" />
<mvc:resources mapping="/js/**" location="/js/" />
<!-- LocaleResolver -->
<bean id="localeResolver" class="org.springframework.web.servlet.i18n.CookieLocaleResolver">
<property name="cookieDomain" value="#{applicationConfig.subDomainName}"/>
<property name="cookieName" value="single_sign_on_lang"/>
<property name="cookieMaxAge" value="604800" />
<!-- auto select language by brower remove -->
<!--<property name="defaultLocale" value="en" /> -->
</bean>
<!-- 消息处理可以直接使用properties的key值返回的是对应的value值 -->
<bean id="messageSource"
class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
<property name="basenames">
<list>
<value>classpath:messages/message</value>
</list>
</property>
<!-- 必须设置成false否则hibernate原有的校验信息无法返回value值-->
<property name="useCodeAsDefaultMessage" value="false"/>
</bean>
<!-- Locale Change Interceptor and Resolver definition -->
<bean id="localeChangeInterceptor" class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor">
<property name="paramName" value="language" />
</bean>
<!-- XML bean Marshaller define -->
<bean id="Jaxb2Marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
<property name="classesToBeBound">
<list>
<value>org.maxkey.domain.xml.UserInfoXML</value>
</list>
</property>
</bean>
<!-- MarshallingHttpMessageConverter -->
<bean id="marshallingHttpMessageConverter" class="org.springframework.http.converter.xml.MarshallingHttpMessageConverter">
<property name="marshaller" ref="Jaxb2Marshaller" />
<property name="unmarshaller" ref="Jaxb2Marshaller" />
<property name="supportedMediaTypes">
<list>
<value>application/xml;charset=UTF-8</value>
</list>
</property>
</bean>
<!--MappingJacksonHttpMessageConverter -->
<bean id="mappingJacksonHttpMessageConverter" class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter">
<property name="supportedMediaTypes">
<list>
<value>application/json;charset=UTF-8</value>
</list>
</property>
</bean>
<!-- REST Client -->
<bean id="restTemplate" class="org.springframework.web.client.RestTemplate">
<property name="messageConverters">
<list>
<ref bean="marshallingHttpMessageConverter" />
<ref bean="mappingJacksonHttpMessageConverter" />
</list>
</property>
</bean>
<!-- AnnotationMethodHandlerAdapter -->
<bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter">
<property name="messageConverters">
<util:list id="beanList">
<ref bean="marshallingHttpMessageConverter" />
<ref bean="mappingJacksonHttpMessageConverter" />
</util:list>
</property>
</bean>
<bean id="handlerMapping" class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping">
<property name="interceptors">
<list>
<ref bean="localeChangeInterceptor" />
</list>
</property>
</bean>
<!-- View Resolver
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver" p:prefix="/templates/" p:suffix=".jsp" p:order="2" />
-->
<!-- upload file support -->
<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<property name="maxUploadSize" value="4194304" />
</bean>
</beans>

View File

@@ -0,0 +1,116 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd">
<!-- Application properties configs -->
<bean id="propertySourcesPlaceholderConfigurer" class="org.springframework.context.support.PropertySourcesPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:config/applicationConfig.properties</value>
<value>classpath:config/applicationLogin.properties</value>
<value>classpath:config/applicationSaml.properties</value>
<value>classpath:config/applicationSocialSignOn.properties</value>
</list>
</property>
<property name="ignoreUnresolvablePlaceholders" value="true"/>
</bean>
<!-- dataSoruce Config -->
<bean id="dataSoruceConfig" class="org.maxkey.config.DataSoruceConfig">
<property name="driverClass" value="${config.datasource.driverclass}"/>
<property name="url" value="${config.datasource.url}"/>
<property name="username" value="${config.datasource.username}"/>
<property name="password" value="${config.datasource.password}"/>
<property name="database" value="${config.datasource.database}"/>
<property name="encrypt" value="true"/>
</bean>
<!-- Character Encoding Config -->
<bean id="characterEncodingConfig" class="org.maxkey.config.CharacterEncodingConfig">
<property name="encoding" value="${config.characterencoding.encoding}"/>
<property name="fromCharSet" value="${config.characterencoding.fromcharset}"/>
<property name="toCharSet" value="${config.characterencoding.tocharset}"/>
</bean>
<!-- email Config -->
<bean id="emailConfig" class="org.maxkey.config.EmailConfig">
<property name="username" value="${config.email.username}"/>
<property name="password" value="${config.email.password}"/>
<property name="smtpHost" value="${config.email.smtpHost}"/>
<property name="port" value="${config.email.port}"/>
<property name="senderMail" value="${config.email.senderMail}"/>
<property name="ssl" value="${config.email.ssl}"/>
</bean>
<!-- Login Config -->
<bean id="loginConfig" class="org.maxkey.config.LoginConfig">
<property name="captcha" value="${config.login.captcha}"/>
<property name="oneTimePwd" value="${config.login.onetimepwd}"/>
<property name="socialSignOn" value="${config.login.socialsignon}"/>
<property name="kerberos" value="${config.login.kerberos}"/>
<property name="wsFederation" value="${config.login.wsfederation}"/>
<property name="remeberMe" value="${config.login.remeberme}"/>
<property name="defaultUri" value="${config.login.default.uri}"/>
</bean>
<!-- Application Config -->
<bean id="applicationConfig" class="org.maxkey.config.ApplicationConfig">
<property name="dataSoruceConfig" ref="dataSoruceConfig"/>
<property name="characterEncodingConfig" ref="characterEncodingConfig"/>
<property name="emailConfig" ref="emailConfig"/>
<property name="loginConfig" ref="loginConfig"/>
<property name="domainName" value="${config.domain.name}"/>
<property name="serverPrefix" value="${config.server.maxkey.uri}"/>
<property name="manageUri" value="${config.manage.uri}"/>
<property name="whiteList" value="${config.ipaddress.whitelist}"/>
<property name="anonymousAccessUrls">
<list>
<value>null</value>
</list>
</property>
</bean>
<!-- Scans the classpath for annotated components that will be auto-registered as Spring beans.
@Controller and @Service. Make sure to set the correct base-package-->
<!-- domain bean -->
<context:component-scan base-package="org.maxkey.domain" />
<context:component-scan base-package="org.maxkey.domain.apps" />
<context:component-scan base-package="org.maxkey.domain.userinfo" />
<!-- REST API interface -->
<context:component-scan base-package="org.maxkey.api.v1.contorller" />
<!-- Business Contorller -->
<context:component-scan base-package="org.maxkey.web.endpoint" />
<context:component-scan base-package="org.maxkey.web.contorller" />
<!-- persistence configuration -->
<import resource="maxkey-persistence.xml"/>
<!-- authn support -->
<import resource="maxkey-support.xml"/>
<!-- single sign on protocol -->
<import resource="maxkey-protocol.xml"/>
<!-- Scheduler task -->
<import resource="maxkey-task.xml"/>
<!-- Basic Authn for user login -->
<import resource="maxkey-security.xml"/>
<!-- web mvc configuration -->
<import resource="maxkey-web.xml"/>
</beans>