Added deployerConfigContext...
Benjamin Renard authored 9 years ago
|
1) <?xml version="1.0" encoding="UTF-8"?>
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) <!--
57) <bean
58) class="org.jasig.cas.authentication.principal.UsernamePasswordCredentialsToPrincipalResolver" />
59) -->
60) <bean
|
Remove original attributeRe...
Benjamin Renard authored 9 years ago
|
61) class="org.esupportail.cas.authentication.principal.UsernamePasswordCredentialsToPrincipalResolver">
62) <property name="attributeRepository" ref="attributeRepository" />
63) </bean>
|
Added deployerConfigContext...
Benjamin Renard authored 9 years ago
|
64)
65) <!--
66) | HttpBasedServiceCredentialsToPrincipalResolver supports HttpBasedCredentials. It supports the CAS 2.0 approach of
67) | authenticating services by SSL callback, extracting the callback URL from the Credentials and representing it as a
68) | SimpleService identified by that callback URL.
69) |
70) | If you are representing services by something more or other than an HTTPS URL whereat they are able to
71) | receive a proxy callback, you will need to change this bean declaration (or add additional declarations).
72) +-->
73) <bean
74) class="org.jasig.cas.authentication.principal.HttpBasedServiceCredentialsToPrincipalResolver" />
75) </list>
76) </property>
77)
78) <!--
79) | Whereas CredentialsToPrincipalResolvers identify who it is some Credentials might authenticate,
80) | AuthenticationHandlers actually authenticate credentials. Here we declare the AuthenticationHandlers that
81) | authenticate the Principals that the CredentialsToPrincipalResolvers identified. CAS will try these handlers in turn
82) | until it finds one that both supports the Credentials presented and succeeds in authenticating.
83) +-->
84) <property name="authenticationHandlers" >
85) <ref bean="handlerList"/>
86) </property>
87) </bean>
88)
89) <bean id="handlerList" class="org.springframework.beans.factory.config.ListFactoryBean">
90) <property name="sourceList">
91) <list>
92) <!--
93) | This is the authentication handler that authenticates services by means of callback via SSL, thereby validating
94) | a server side SSL certificate.
95) +-->
96) <bean class="org.jasig.cas.authentication.handler.support.HttpBasedServiceCredentialsAuthenticationHandler"
97) p:httpClient-ref="httpClient" />
98) </list>
99) </property>
100) </bean>
101)
102) <bean id="handlerDiscover" class="org.esupportail.cas.HandlersDiscover">
103) <property name="handlersId" value="${cas.authHandlers}"/>
104) <property name="listToAdd" ref="handlerList"/>
105) </bean>
106)
107) <!--
108) This bean defines the security roles for the Services Management application. Simple deployments can use the in-memory version.
109) More robust deployments will want to use another option, such as the Jdbc version.
110)
111) The name of this should remain "userDetailsService" in order for Spring Security to find it.
112) -->
113) <!-- <sec:user name="@@THIS SHOULD BE REPLACED@@" password="notused" authorities="ROLE_ADMIN" />-->
114)
115) <sec:user-service id="userDetailsService">
116) <sec:user name="${security.useradmin}" password="notused" authorities="ROLE_ADMIN" />
117) </sec:user-service>
118)
119) <!--
120) Sample, in-memory data store for the ServiceRegistry. A real implementation
121) would probably want to replace this with the JPA-backed ServiceRegistry DAO
122) The name of this bean should remain "serviceRegistryDao".
123) -->
124) <bean
125) id="serviceRegistryDao"
126) class="org.jasig.cas.services.InMemoryServiceRegistryDaoImpl">
127) <property name="registeredServices">
128) <list>
129) <bean class="org.jasig.cas.services.RegisteredServiceImpl">
130) <property name="id" value="0" />
131) <property name="name" value="HTTP" />
132) <property name="description" value="Only Allows HTTP Urls" />
133) <property name="serviceId" value="http://**" />
|
Added allowedAttributes in...
Benjamin Renard authored 9 years ago
|
134) <property name="allowedAttributes">
135) <list>
136) <value>name</value>
137) <value>firstname</value>
138) <value>lastname</value>
139) <value>mail</value>
140) <value>login</value>
141) </list>
142) </property>
|
Added deployerConfigContext...
Benjamin Renard authored 9 years ago
|
143) </bean>
144)
145) <bean class="org.jasig.cas.services.RegisteredServiceImpl">
146) <property name="id" value="1" />
147) <property name="name" value="HTTPS" />
148) <property name="description" value="Only Allows HTTPS Urls" />
149) <property name="serviceId" value="https://**" />
|
Added allowedAttributes in...
Benjamin Renard authored 9 years ago
|
150) <property name="allowedAttributes">
151) <list>
152) <value>name</value>
153) <value>firstname</value>
154) <value>lastname</value>
155) <value>mail</value>
156) <value>login</value>
157) </list>
158) </property>
|