5d10c7356793f52c42eae42b4bd666e73ed870e6
[aaa.git] / aaa-shiro / impl / src / main / resources / OSGI-INF / blueprint / impl-blueprint.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!-- vi: set et smarttab sw=4 tabstop=4: -->
3 <!--
4 Copyright © 2017 Brocade Communications Systems and others. All rights reserved.
5
6 This program and the accompanying materials are made available under the
7 terms of the Eclipse Public License v1.0 which accompanies this distribution,
8 and is available at http://www.eclipse.org/legal/epl-v10.html
9 -->
10 <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
11   xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0">
12
13   <odl:clustered-app-config
14           binding-class="org.opendaylight.yang.gen.v1.urn.opendaylight.aaa.app.config.rev170619.ShiroConfiguration"
15           id="shiroConfiguration" default-config-file-name="aaa-app-config.xml" />
16
17   <odl:clustered-app-config id="datastoreConfig"
18         default-config-file-name="aaa-datastore-config.xml"
19         binding-class="org.opendaylight.yang.gen.v1.urn.opendaylight.aaa.app.config.rev170619.DatastoreConfig" />
20
21   <reference id="authService" interface="org.opendaylight.aaa.api.AuthenticationService"/>
22   <reference id="passwordService" interface="org.opendaylight.aaa.api.password.service.PasswordHashService"/>
23   <reference id="idmStore" interface ="org.opendaylight.aaa.api.IIDMStore"/>
24
25   <reference id="passwordCredentialAuth" interface="org.opendaylight.aaa.api.PasswordCredentialAuth"/>
26   <reference id="claimCache" interface="org.opendaylight.aaa.api.ClaimCache"/>
27
28   <reference id="dataBroker" interface="org.opendaylight.mdsal.binding.api.DataBroker"/>
29
30   <reference id="certManager" interface="org.opendaylight.aaa.cert.api.ICertificateManager"/>
31
32   <bean id="provider" class="org.opendaylight.aaa.AAAShiroProvider" init-method="init" destroy-method="close">
33     <argument ref="passwordCredentialAuth" />
34     <argument ref="datastoreConfig" />
35     <argument ref="idmStore" />
36   </bean>
37
38   <bean id="shiroWebEnvLoader" class="org.opendaylight.aaa.shiro.web.env.ShiroWebEnvironmentLoaderListener">
39     <argument ref="shiroConfiguration"/>
40     <argument ref="dataBroker"/>
41     <argument ref="certManager"/>
42     <argument ref="authService" />
43     <argument>
44       <bean factory-ref="provider" factory-method="getTokenAuthenticators"/>
45     </argument>
46     <argument>
47       <bean factory-ref="provider" factory-method="getTokenStore"/>
48     </argument>
49     <argument ref="passwordService" />
50   </bean>
51   <service ref="shiroWebEnvLoader" interface="javax.servlet.ServletContextListener"/>
52
53   <reference id="customFilterAdapterConfig"
54       interface="org.opendaylight.aaa.filterchain.configuration.CustomFilterAdapterConfiguration"/>
55
56   <bean id="webContextSecurer" class="org.opendaylight.aaa.shiro.web.env.ShiroWebContextSecurer">
57     <argument ref="shiroWebEnvLoader"/>
58   </bean>
59   <service ref="webContextSecurer" interface="org.opendaylight.aaa.web.WebContextSecurer" />
60
61   <reference id="webServer" interface="org.opendaylight.aaa.web.WebServer" />
62
63   <reference id="servletSupport" interface="org.opendaylight.aaa.web.servlet.ServletSupport" />
64
65   <bean id="webInitializer" class="org.opendaylight.aaa.shiro.web.env.WebInitializer" destroy-method="close">
66     <argument ref="webServer"/>
67     <argument ref="claimCache"/>
68     <argument ref="idmStore"/>
69     <argument ref="webContextSecurer"/>
70     <argument ref="servletSupport"/>
71     <argument ref="customFilterAdapterConfig"/>
72   </bean>
73 </blueprint>