cas 傻瓜翻译deployerConfigContext.xml

<?xml version="1.0" encoding="UTF-8"?>
<!-- |deployerConfigContext。 xml集中到一个文件中声明式配置 |所有中科院部署人员需要修改。 | |该文件声明一些spring管理的javabean,中科院部署。 
	  |在这个文件中声明的bean实例化上下文初始化时候的春天 | ContextLoaderListener web . xml中声明。 找到这个文件,因为这 
	|文件中声明的上下文参数“contextConfigLocation”。 | |到目前为止最常见的改变需要使这个文件是改变最后一个bean 替换默认SimpleTestUsernamePasswordAuthenticationHandler 
	|宣言 |你实现一个用户名和密码进行身份验证的方法。 + -->
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
	<!-- AuthenticationManager这个bean声明。 CentralAuthenticationService服务bean |在applicationContext声明。 
		通过引用xml拿起这AuthenticationManager id, |“authenticationManager”。 大多数部署人员可以使用默认AuthenticationManager 
		|实现,所以不需要改变这个bean的类。 我们包括整个 | AuthenticationManager userConfigContext这里。 
		xml,这样您就可以看到的东西 |需要上下文的变化。 + -->
	<bean id="authenticationManager" class="org.jasig.cas.authentication.AuthenticationManagerImpl">
		<!-- 这是CredentialToPrincipalResolvers列表,找出主要试图验证。 | AuthenticationManagerImpl认为他们为了找到一个CredentialToPrincipalResolver哪个 
			|支持凭证。 | | AuthenticationManagerImpl使用这些解析器有两个目的。 首先,它使用它们来确定校长 |试图CAS /登录进行身份验证。 
			在默认配置中,DefaultCredentialsToPrincipalResolver |,填补了这个角色。 如果您使用的是其他类型的比UsernamePasswordCredentials凭证,需要替换 
			| DefaultCredentialsToPrincipalResolver CredentialsToPrincipalResolver支持的凭证 
			|使用。 | |第二,AuthenticationManagerImpl使用这些解析器来确定一个服务请求代理授予票。 |在默认配置中,正是HttpBasedServiceCredentialsToPrincipalResolver符合这个目的。 
			|你需要改变这个列表识别服务比他们的回调URL或其他更多的东西。 + -->
		<property name="credentialsToPrincipalResolvers">
			<list>
				<!-- | UsernamePasswordCredentialsToPrincipalResolver支持我们使用的UsernamePasswordCredentials 
					/登录 |默认并产生SimplePrincipal实例传递用户名的凭证。 | |如果你改变了你LoginFormAction UsernamePasswordCredentials以外的使用凭证然后你也会 
					|需要改变这个bean声明(或添加额外的声明)宣布CredentialsToPrincipalResolver支持 |凭证使用。 + -->
				<bean
					class="org.jasig.cas.authentication.principal.UsernamePasswordCredentialsToPrincipalResolver">
					<!-- <property name="attributeRepository" ref="attributeRepository"/> -->

				</bean>


				<!-- |HttpBasedServiceCredentialsToPrincipalResolver支持HttpBasedCredentials。 
					它支持CAS 2.0的方法 |由SSL身份验证服务回调,提取凭证的回调URL并作为代表 | SimpleService确定的回调URL。 | |如果你是代表服务更多的东西或其他在那里他们能够比一个HTTPS 
					URL |收到代理回调,你需要改变这个bean声明(或添加额外的声明)。 + -->
				<bean
					class="org.jasig.cas.authentication.principal.HttpBasedServiceCredentialsToPrincipalResolver" />
			</list>
		</property>

		<!-- 而CredentialsToPrincipalResolvers识别谁是一些凭据进行身份验证, | AuthenticationHandlers实际上凭据进行身份验证。 
			在这里,我们声明的AuthenticationHandlers | CredentialsToPrincipalResolvers的主体识别进行身份验证。 
			中科院尝试将这些处理程序 |,直到找到一个支持提供的凭证和成功进行身份验证。 + -->
		<property name="authenticationHandlers">
			<list>


				<!-- |这是身份验证处理器通过SSL验证服务通过回调,从而验证 |一个服务器端SSL证书。 + -->
				<bean
					class="org.jasig.cas.authentication.handler.support.HttpBasedServiceCredentialsAuthenticationHandler"
					p:httpClient-ref="httpClient" />
				<!-- |这是身份验证处理程序声明每个CAS部署人员需要改变之前部署CAS |投入生产。 默认SimpleTestUsernamePasswordAuthenticationHandler 
					UsernamePasswordCredentials进行身份验证 用户名=密码|。 您将需要更换这个AuthenticationHandler实现你的 
					|本地身份验证策略。 要做到这一点,你可能编码一个新的处理程序和声明等 | edu.someschool.its.cas。 MySpecialHandler在这里,或者你可以使用一个适配器提供的处理程序模块。 
					+ -->
				<!-- <bean class="org.jasig.cas.authentication.handler.support.SimpleTestUsernamePasswordAuthenticationHandler" 
					/> -->

				<bean
					class="org.jasig.cas.adaptors.jdbc.AvicitQueryDatabaseAuthenticationHandler">
					<property name="dataSource" ref="oarcleDataSource" />
					<property name="sql"
						value="select u.LOGIN_PASSWORD as password from sys_user u where lower(u.LOGIN_NAME) = lower(?)" />
					<property name="passwordEncoder" ref="passwordEncoder" />
				</bean>

				<!-- <bean class="com.avicit.cas.adaptors.ldap.AvicitBindLdapAuthenticationHandler"> 
					<property name="filter" value="uid=%u" /> <property name="searchBase" value="ou=Users,dc=avic,dc=com" 
					/> <property name="contextSource" ref="contextSource" /> </bean> -->
			</list>
		</property>
	</bean>


	<!-- 这个bean定义的安全角色服务管理应用程序。 简单的部署可以使用内存中的版本。 更健壮的部署会想使用另一个选项,如Jdbc的版本。 这个应该保持的名字“userDetailsService”为了让Acegi找到它。 
		使用这个,你应该添加一个条目类似如下两个值之间的标签: battags = notused ROLE_ADMIN battags在哪里你想授权访问的用户名。 
		你可以把每行一个条目。 -->
	<bean id="userDetailsService"
		class="org.springframework.security.userdetails.memory.InMemoryDaoImpl">
		<property name="userMap">
			<value>

			</value>
		</property>
	</bean>

	<!-- Bean that defines the attributes that a service may return. This example 
		uses the Stub/Mock version. A real implementation may go against a database 
		or LDAP server. The id should remain "attributeRepository" though. -->
	<!-- <bean id="attributeRepository" class="org.jasig.services.persondir.support.StubPersonAttributeDao"> 
		<property name="backingMap"> <map> <entry key="uid" value="uid" /> <entry 
		key="eduPersonAffiliation" value="eduPersonAffiliation" /> <entry key="groupMembership" 
		value="groupMembership" /> </map> </property> </bean> -->


	<bean id="attributeRepository"
		class="com.avicit.cas.persondir.support.AvicitSingleRowJdbcPersonAttributeDao">
		<constructor-arg index="0" ref="oarcleDataSource" />
		<constructor-arg index="1">
			<list>
				<value>username</value>
			</list>
		</constructor-arg>
		<!-- <constructor-arg index="2" value="select * from SYS_USER_SSO_MAP where 
			USERINTERNALID=?"/> -->
		<constructor-arg index="2"
			value="select t.service_name_zh as WEB_NAME,um.user_name as WEB_USERNAME from sys_service t,sys_user_service_map um where t.id=um.sys_service_id and USERINTERNALID=?" />

		<property name="columnsToAttributes">
			<map>
				<!-- <entry key="username" value="username"/> <entry key="age" value="user_age"/> -->
			</map>
		</property>
		<!-- 对应用户信息格式“系统代码$$登录用户代码@@系统代码$$登录用户代码.....” 例如:oa$$user001@@cms$$k001 -->
		<property name="userInfo">
			<value>appUserName</value>
		</property>

	</bean>


	<!-- ServiceRegistry样本,内存中的数据存储。 一个真正的实现 可能要更换这个与JPA-backed ServiceRegistry刀吗 
		这个bean的名称应该是“serviceRegistryDao”。 -->
	<bean id="serviceRegistryDao" class="org.jasig.cas.services.InMemoryServiceRegistryDaoImpl" />

	<bean id="mysqldataSource" class="org.apache.commons.dbcp.BasicDataSource"
		destroy-method="close">
		<property name="driverClassName">
			<value>com.mysql.jdbc.Driver</value>
		</property>
		<property name="url">
			<value>jdbc:mysql://localhost:3306/cas</value>
		</property>
		<property name="username">
			<value>root</value>
		</property>
		<property name="password">
			<value>123</value>
		</property>
		<property name="maxActive" value="6" />
		<property name="maxIdle" value="4" />
		<property name="initialSize" value="1" />
	</bean>
	<bean id="oarcleDataSource" class="org.apache.commons.dbcp.BasicDataSource"
		destroy-method="close">
		<property name="driverClassName">
			<value>oracle.jdbc.driver.OracleDriver</value>
		</property>
		<property name="url">
			<value>jdbc:oracle:thin:@10.216.60.188:1521:orcl2</value>
		</property>
		<property name="username">
			<value>ea</value>
		</property>
		<property name="password">
			<value>cape</value>
		</property>
		<property name="maxActive" value="6" />
		<property name="maxIdle" value="4" />
		<property name="initialSize" value="1" />
	</bean>


	<bean id="passwordEncoder"
		class="org.jasig.cas.authentication.handler.DefaultPasswordEncoder">
		<constructor-arg value="MD5" />
	</bean>

	<bean id="contextSource" class="org.springframework.ldap.core.support.LdapContextSource">
		<property name="pooled" value="true" />
		<property name="urls">
			<list>
				<value>ldap://localhost:389/</value>
			</list>
		</property>
		<property name="userDn" value="cn=admin" />
		<property name="password" value="123" />
		<property name="baseEnvironmentProperties">
			<map>
				<entry>
					<key>
						<value>java.naming.security.authentication</value>
					</key>
					<value>simple</value>
				</entry>
			</map>
		</property>
	</bean>
</beans>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值