Guest User

deployerConfigContext.xml

a guest
Apr 6th, 2016
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 9.23 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3.  
  4.    Licensed to Apereo under one or more contributor license
  5.    agreements. See the NOTICE file distributed with this work
  6.    for additional information regarding copyright ownership.
  7.    Apereo licenses this file to you under the Apache License,
  8.    Version 2.0 (the "License"); you may not use this file
  9.    except in compliance with the License.  You may obtain a
  10.    copy of the License at the following location:
  11.  
  12.      http://www.apache.org/licenses/LICENSE-2.0
  13.  
  14.    Unless required by applicable law or agreed to in writing,
  15.    software distributed under the License is distributed on an
  16.    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  17.    KIND, either express or implied.  See the License for the
  18.    specific language governing permissions and limitations
  19.    under the License.
  20.  
  21. -->
  22. <!--
  23. | deployerConfigContext.xml centralizes into one file some of the declarative configuration that
  24. | all CAS deployers will need to modify.
  25. |
  26. | This file declares some of the Spring-managed JavaBeans that make up a CAS deployment.
  27. | The beans declared in this file are instantiated at context initialization time by the Spring
  28. | ContextLoaderListener declared in web.xml.  It finds this file because this
  29. | file is among those declared in the context parameter "contextConfigLocation".
  30. |
  31. | By far the most common change you will need to make in this file is to change the last bean
  32. | declaration to replace the default authentication handler with
  33. | one implementing your approach for authenticating usernames and passwords.
  34. +-->
  35.  
  36. <beans xmlns="http://www.springframework.org/schema/beans"
  37.       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  38.       xmlns:p="http://www.springframework.org/schema/p"
  39.       xmlns:c="http://www.springframework.org/schema/c"
  40.       xmlns:tx="http://www.springframework.org/schema/tx"
  41.       xmlns:util="http://www.springframework.org/schema/util"
  42.       xmlns:sec="http://www.springframework.org/schema/security"
  43.       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  44.       http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
  45.       http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security.xsd
  46.       http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
  47.  
  48.     <!--
  49.       | The authentication manager defines security policy for authentication by specifying at a minimum
  50.       | the authentication handlers that will be used to authenticate credential. While the AuthenticationManager
  51.       | interface supports plugging in another implementation, the default PolicyBasedAuthenticationManager should
  52.       | be sufficient in most cases.
  53.       +-->
  54.     <bean id="authenticationManager" class="org.jasig.cas.authentication.PolicyBasedAuthenticationManager">
  55.         <constructor-arg>
  56.             <map>
  57.                 <!--
  58.                   | IMPORTANT
  59.                   | Every handler requires a unique name.
  60.                   | If more than one instance of the same handler class is configured, you must explicitly
  61.                   | set its name to something other than its default name (typically the simple class name).
  62.                   -->
  63.                 <entry key-ref="proxyAuthenticationHandler" value-ref="proxyPrincipalResolver" />
  64.                 <entry key-ref="SearchModeSearchDatabaseAuthenticationHandler" value-ref="primaryPrincipalResolver" />
  65.                 <!--entry key-ref="primaryAuthenticationHandler" value-ref="primaryPrincipalResolver" /-->
  66.             </map>
  67.         </constructor-arg>
  68.  
  69.         <!-- Uncomment the metadata populator to capture the password.
  70.        <property name="authenticationMetaDataPopulators">
  71.           <util:list>
  72.               <bean class="org.jasig.cas.authentication.CacheCredentialsMetaDataPopulator"/>
  73.           </util:list>
  74.        </property>
  75.        -->
  76.  
  77.         <!--
  78.           | Defines the security policy around authentication. Some alternative policies that ship with CAS:
  79.           |
  80.           | * NotPreventedAuthenticationPolicy - all credential must either pass or fail authentication
  81.           | * AllAuthenticationPolicy - all presented credential must be authenticated successfully
  82.           | * RequiredHandlerAuthenticationPolicy - specifies a handler that must authenticate its credential to pass
  83.           -->
  84.         <property name="authenticationPolicy">
  85.             <bean class="org.jasig.cas.authentication.AnyAuthenticationPolicy" />
  86.         </property>
  87.     </bean>
  88.  
  89.     <!-- Required for proxy ticket mechanism. -->
  90.     <bean id="proxyAuthenticationHandler"
  91.          class="org.jasig.cas.authentication.handler.support.HttpBasedServiceCredentialsAuthenticationHandler"
  92.          p:httpClient-ref="supportsTrustStoreSslSocketFactoryHttpClient" />
  93.  
  94.     <!-- Authentication method start-->
  95. <bean id="dataSource"
  96.  class="com.mchange.v2.c3p0.ComboPooledDataSource"
  97.  p:driverClass="com.mysql.jdbc.Driver"
  98.  p:jdbcUrl="jdbc:mysql://localhost:3306/propadmin"
  99.  p:user="root"
  100.  p:password="infoedge" />
  101.  
  102. <!-- Authentication method end-->
  103. <bean id="passwordEncoder"
  104.      class="org.jasig.cas.authentication.handler.DefaultPasswordEncoder"
  105.      c:encodingAlgorithm="MD5"
  106.      p:characterEncoding="UTF-8" />
  107.  
  108. <bean id="SearchModeSearchDatabaseAuthenticationHandler"
  109.      class="org.jasig.cas.adaptors.jdbc.SearchModeSearchDatabaseAuthenticationHandler"
  110.      p:dataSource-ref="dataSource"
  111.      p:passwordEncoder-ref="passwordEncoder"
  112.      p:tableUsers="PSWRDS"
  113.      p:fieldUser="USERNAME"
  114.      p:fieldPassword="PASSWORD" />
  115.  
  116.    
  117.    
  118.  
  119.     <!--
  120.       | TODO: Replace this component with one suitable for your enviroment.
  121.       |
  122.       | This component provides authentication for the kind of credential used in your environment. In most cases
  123.       | credential is a username/password pair that lives in a system of record like an LDAP directory.
  124.       | The most common authentication handler beans:
  125.       |
  126.       | * org.jasig.cas.authentication.LdapAuthenticationHandler
  127.       | * org.jasig.cas.adaptors.jdbc.QueryDatabaseAuthenticationHandler
  128.       | * org.jasig.cas.adaptors.x509.authentication.handler.support.X509CredentialsAuthenticationHandler
  129.       | * org.jasig.cas.support.spnego.authentication.handler.support.JCIFSSpnegoAuthenticationHandler
  130.       -->
  131.     <!--bean id="primaryAuthenticationHandler"
  132.          class="org.jasig.cas.authentication.AcceptUsersAuthenticationHandler">
  133.        <property name="users">
  134.            <map>
  135.                <entry key="casuser" value="Mellon"/>
  136.            </map>
  137.        </property>
  138.    </bean-->
  139.  
  140.     <!-- Required for proxy ticket mechanism -->
  141.     <bean id="proxyPrincipalResolver"
  142.          class="org.jasig.cas.authentication.principal.BasicPrincipalResolver" />
  143.  
  144.     <!--
  145.       | Resolves a principal from a credential using an attribute repository that is configured to resolve
  146.       | against a deployer-specific store (e.g. LDAP).
  147.       -->
  148.     <bean id="primaryPrincipalResolver"
  149.          class="org.jasig.cas.authentication.principal.PersonDirectoryPrincipalResolver"
  150.          p:principalFactory-ref="principalFactory"
  151.          p:attributeRepository-ref="attributeRepository" />
  152.  
  153.     <!--
  154.    Bean that defines the attributes that a service may return.  This example uses the Stub/Mock version.  A real implementation
  155.    may go against a database or LDAP server.  The id should remain "attributeRepository" though.
  156.    +-->
  157.     <bean id="attributeRepository" class="org.jasig.services.persondir.support.NamedStubPersonAttributeDao"
  158.          p:backingMap-ref="attrRepoBackingMap" />
  159.  
  160.     <util:map id="attrRepoBackingMap">
  161.         <entry key="uid" value="uid" />
  162.         <entry key="eduPersonAffiliation" value="eduPersonAffiliation" />
  163.         <entry key="groupMembership" value="groupMembership" />
  164.         <entry>
  165.             <key><value>memberOf</value></key>
  166.             <list>
  167.                 <value>faculty</value>
  168.                 <value>staff</value>
  169.                 <value>org</value>
  170.             </list>
  171.         </entry>
  172.     </util:map>
  173.  
  174.     <bean id="serviceRegistryDao" class="org.jasig.cas.services.JsonServiceRegistryDao"
  175.          c:configDirectory="${service.registry.config.location:classpath:services}" />
  176.  
  177.     <bean id="auditTrailManager" class="org.jasig.inspektr.audit.support.Slf4jLoggingAuditTrailManager" />
  178.  
  179.     <bean id="healthCheckMonitor" class="org.jasig.cas.monitor.HealthCheckMonitor" p:monitors-ref="monitorsList" />
  180.  
  181.     <util:list id="monitorsList">
  182.         <bean class="org.jasig.cas.monitor.MemoryMonitor" p:freeMemoryWarnThreshold="10" />
  183.         <!--
  184.          NOTE
  185.          The following ticket registries support SessionMonitor:
  186.            * DefaultTicketRegistry
  187.            * JpaTicketRegistry
  188.          Remove this monitor if you use an unsupported registry.
  189.        -->
  190.         <bean class="org.jasig.cas.monitor.SessionMonitor"
  191.              p:ticketRegistry-ref="ticketRegistry"
  192.              p:serviceTicketCountWarnThreshold="5000"
  193.              p:sessionCountWarnThreshold="100000" />
  194.     </util:list>
  195. </beans>
Add Comment
Please, Sign In to add comment