HSAdmin Backend Domains, E-Mail, Datenbanken
Peter Hormanns
2010-09-20 7052ea9fe30de6f910b1df42f28d773837370b6b
commit | author | age
7f6432 1 <?xml version="1.0" encoding="UTF-8"?>
PH 2 <!--
3     | deployerConfigContext.xml centralizes into one file some of the declarative configuration that
4     | all CAS deployers will need to modify.
5     |
6     | This file declares some of the Spring-managed JavaBeans that make up a CAS deployment.  
7     | The beans declared in this file are instantiated at context initialization time by the Spring 
8     | ContextLoaderListener declared in web.xml.  It finds this file because this
9     | file is among those declared in the context parameter "contextConfigLocation".
10     |
11     | By far the most common change you will need to make in this file is to change the last bean
12     | declaration to replace the default SimpleTestUsernamePasswordAuthenticationHandler with
13     | one implementing your approach for authenticating usernames and passwords.
14     +-->
15 <beans xmlns="http://www.springframework.org/schema/beans"
16        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
17        xmlns:p="http://www.springframework.org/schema/p"
18        xmlns:sec="http://www.springframework.org/schema/security"
19        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
20        http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd">
21     <!--
22         | This bean declares our AuthenticationManager.  The CentralAuthenticationService service bean
23         | declared in applicationContext.xml picks up this AuthenticationManager by reference to its id, 
24         | "authenticationManager".  Most deployers will be able to use the default AuthenticationManager
25         | implementation and so do not need to change the class of this bean.  We include the whole
26         | AuthenticationManager here in the userConfigContext.xml so that you can see the things you will
27         | need to change in context.
28         +-->
29     <bean id="authenticationManager"
30         class="org.jasig.cas.authentication.AuthenticationManagerImpl">
31         <!--
32             | This is the List of CredentialToPrincipalResolvers that identify what Principal is trying to authenticate.
33             | The AuthenticationManagerImpl considers them in order, finding a CredentialToPrincipalResolver which 
34             | supports the presented credentials.
35             |
36             | AuthenticationManagerImpl uses these resolvers for two purposes.  First, it uses them to identify the Principal
37             | attempting to authenticate to CAS /login .  In the default configuration, it is the DefaultCredentialsToPrincipalResolver
38             | that fills this role.  If you are using some other kind of credentials than UsernamePasswordCredentials, you will need to replace
39             | DefaultCredentialsToPrincipalResolver with a CredentialsToPrincipalResolver that supports the credentials you are
40             | using.
41             |
42             | Second, AuthenticationManagerImpl uses these resolvers to identify a service requesting a proxy granting ticket. 
43             | In the default configuration, it is the HttpBasedServiceCredentialsToPrincipalResolver that serves this purpose. 
44             | You will need to change this list if you are identifying services by something more or other than their callback URL.
45             +-->
46         <property name="credentialsToPrincipalResolvers">
47             <list>
48                 <!--
49                     | UsernamePasswordCredentialsToPrincipalResolver supports the UsernamePasswordCredentials that we use for /login 
50                     | by default and produces SimplePrincipal instances conveying the username from the credentials.
51                     | 
52                     | If you've changed your LoginFormAction to use credentials other than UsernamePasswordCredentials then you will also
53                     | need to change this bean declaration (or add additional declarations) to declare a CredentialsToPrincipalResolver that supports the
54                     | Credentials you are using.
55                     +-->
56                 <bean
57                     class="org.jasig.cas.authentication.principal.UsernamePasswordCredentialsToPrincipalResolver" />
58                 <!--
59                     | HttpBasedServiceCredentialsToPrincipalResolver supports HttpBasedCredentials.  It supports the CAS 2.0 approach of
60                     | authenticating services by SSL callback, extracting the callback URL from the Credentials and representing it as a
61                     | SimpleService identified by that callback URL.
62                     |
63                     | If you are representing services by something more or other than an HTTPS URL whereat they are able to
64                     | receive a proxy callback, you will need to change this bean declaration (or add additional declarations).
65                     +-->
66                 <bean
67                     class="org.jasig.cas.authentication.principal.HttpBasedServiceCredentialsToPrincipalResolver" />
68             </list>
69         </property>
70
71         <!--
72             | Whereas CredentialsToPrincipalResolvers identify who it is some Credentials might authenticate, 
73             | AuthenticationHandlers actually authenticate credentials.  Here we declare the AuthenticationHandlers that
74             | authenticate the Principals that the CredentialsToPrincipalResolvers identified.  CAS will try these handlers in turn
75             | until it finds one that both supports the Credentials presented and succeeds in authenticating.
76             +-->
77         <property name="authenticationHandlers">
78             <list>
79                 <!--
80                     | This is the authentication handler that authenticates services by means of callback via SSL, thereby validating
81                     | a server side SSL certificate.
82                     +-->
83                 <bean class="org.jasig.cas.authentication.handler.support.HttpBasedServiceCredentialsAuthenticationHandler"
84                     p:httpClient-ref="httpClient" />
85                 <!--
86                     | This is the authentication handler declaration that every CAS deployer will need to change before deploying CAS 
87                     | into production.  The default SimpleTestUsernamePasswordAuthenticationHandler authenticates UsernamePasswordCredentials
88                     | where the username equals the password.  You will need to replace this with an AuthenticationHandler that implements your
89                     | local authentication strategy.  You might accomplish this by coding a new such handler and declaring
90                     | edu.someschool.its.cas.MySpecialHandler here, or you might use one of the handlers provided in the adaptors modules.
91                     +-->
92                 <bean
93                     class="de.hsadmin.cas.SmtpAuthenticator" />
94             </list>
95         </property>
96     </bean>
97
98
99     <!--
100     This bean defines the security roles for the Services Management application.  Simple deployments can use the in-memory version.
101     More robust deployments will want to use another option, such as the Jdbc version.
102     
103     The name of this should remain "userDetailsService" in order for Spring Security to find it.
104     
105     To use this, you should add an entry similar to the following between the two value tags:
106     battags=notused,ROLE_ADMIN
107     
108     where battags is the username you want to grant access to.  You can put one entry per line.
109      -->
110     <!-- <sec:user name="@@THIS SHOULD BE REPLACED@@" password="notused" authorities="ROLE_ADMIN" />-->
111
112     <sec:user-service id="userDetailsService">
113         <sec:user name="pe" password="notused" authorities="ROLE_ADMIN" />
114     </sec:user-service>
115     
116     <!-- 
117     Bean that defines the attributes that a service may return.  This example uses the Stub/Mock version.  A real implementation
118     may go against a database or LDAP server.  The id should remain "attributeRepository" though.
119      -->
120     <bean id="attributeRepository"
121         class="org.jasig.services.persondir.support.StubPersonAttributeDao">
122         <property name="backingMap">
123             <map>
124                 <entry key="uid" value="uid" />
125                 <entry key="eduPersonAffiliation" value="eduPersonAffiliation" /> 
126                 <entry key="groupMembership" value="groupMembership" />
127             </map>
128         </property>
129     </bean>
130     
131     <!-- 
132     Sample, in-memory data store for the ServiceRegistry. A real implementation
133     would probably want to replace this with the JPA-backed ServiceRegistry DAO
134     The name of this bean should remain "serviceRegistryDao".
135      -->
136     <bean
137         id="serviceRegistryDao"
138         class="org.jasig.cas.services.InMemoryServiceRegistryDaoImpl">
139             <property name="registeredServices">
140                 <list>
141                     <bean class="org.jasig.cas.services.RegisteredServiceImpl">
142                         <property name="id" value="0" />
143                         <property name="name" value="HTTP" />
144                         <property name="description" value="Only Allows HTTP Urls" />
145                         <property name="serviceId" value="http://**" />
146                     </bean>
147
148                     <bean class="org.jasig.cas.services.RegisteredServiceImpl">
149                         <property name="id" value="1" />
150                         <property name="name" value="HTTPS" />
151                         <property name="description" value="Only Allows HTTPS Urls" />
152                         <property name="serviceId" value="https://**" />
153                     </bean>
154
155                     <bean class="org.jasig.cas.services.RegisteredServiceImpl">
156                         <property name="id" value="2" />
157                         <property name="name" value="IMAPS" />
158                         <property name="description" value="Only Allows HTTPS Urls" />
159                         <property name="serviceId" value="imaps://**" />
160                     </bean>
161
162                     <bean class="org.jasig.cas.services.RegisteredServiceImpl">
163                         <property name="id" value="3" />
164                         <property name="name" value="IMAP" />
165                         <property name="description" value="Only Allows IMAP Urls" />
166                         <property name="serviceId" value="imap://**" />
167                     </bean>
168                 </list>
169             </property>
170         </bean>
171 </beans>