adjust to use password-service
[aaa.git] / aaa-shiro / impl / src / main / resources / org / opendaylight / 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   xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
13   odl:use-default-for-reference-types="true">
14
15   <odl:clustered-app-config
16           binding-class="org.opendaylight.yang.gen.v1.urn.opendaylight.aaa.app.config.rev170619.ShiroConfiguration"
17           id="shiroConfiguration" default-config-file-name="aaa-app-config.xml" />
18
19   <odl:clustered-app-config id="datastoreConfig"
20         default-config-file-name="aaa-datastore-config.xml"
21         binding-class="org.opendaylight.yang.gen.v1.urn.opendaylight.aaa.app.config.rev170619.DatastoreConfig" />
22
23   <reference id="passwordService" interface="org.opendaylight.aaa.api.password.service.PasswordHashService"
24         odl:type="default"/>
25
26   <bean id="idmStore" class="org.opendaylight.aaa.datastore.h2.H2Store">
27     <argument value="${dbUsername}" />
28     <argument value="${dbPassword}" />
29     <argument ref="passwordService" />
30   </bean>
31
32   <bean id="idmLightProxy" class="org.opendaylight.aaa.shiro.idm.IdmLightProxy">
33     <argument ref="idmStore" />
34     <argument ref="passwordService" />
35   </bean>
36
37   <bean id="authService" class="org.opendaylight.aaa.shiro.tokenauthrealm.auth.AuthenticationManager"/>
38
39   <service ref="idmStore" interface="org.opendaylight.aaa.api.IIDMStore" odl:type="default"/>
40
41   <service ref="idmLightProxy" odl:type="default">
42     <interfaces>
43       <value>org.opendaylight.aaa.api.IdMService</value>
44       <value>org.opendaylight.aaa.api.CredentialAuth</value>
45       <value>org.opendaylight.aaa.api.ClaimCache</value>
46     </interfaces>
47   </service>
48
49   <reference id="dataBroker"
50     interface="org.opendaylight.controller.md.sal.binding.api.DataBroker"
51     odl:type="default" />
52
53   <reference id="certManager"
54     interface="org.opendaylight.aaa.cert.api.ICertificateManager"
55     odl:type="default-certificate-manager" />
56
57   <reference id="httpService"
58              interface="org.osgi.service.http.HttpService"/>
59
60   <!-- TODO: when we migrate off h2 towards the MD-SAL DS, get rid of this. -->
61   <cm:property-placeholder persistent-id="org.opendaylight.aaa.h2">
62     <cm:default-properties>
63       <cm:property name="dbUsername" value="foo" />
64       <cm:property name="dbPassword" value="bar" />
65     </cm:default-properties>
66   </cm:property-placeholder>
67
68   <bean id="provider"
69         class="org.opendaylight.aaa.AAAShiroProvider"
70         init-method="init" destroy-method="close">
71     <argument ref="dataBroker" />
72     <argument ref="certManager" />
73     <argument ref="idmLightProxy" />
74     <argument ref="shiroConfiguration" />
75     <argument ref="httpService" />
76     <argument value="/moon" />
77     <argument value="/oauth2" />
78     <argument ref="datastoreConfig" />
79     <argument ref="idmStore" />
80     <argument ref="authService" />
81     <argument ref="passwordService" />
82   </bean>
83
84   <bean id="authenticator" class="org.opendaylight.aaa.authenticator.ODLAuthenticator" />
85   <service ref="authenticator" interface="org.jolokia.osgi.security.Authenticator" />
86
87   <bean id="shiroWebEnvLoader" class="org.opendaylight.aaa.shiro.web.env.ShiroWebEnvironmentLoaderListener">
88     <argument ref="shiroConfiguration"/>
89     <argument ref="dataBroker"/>
90     <argument ref="certManager"/>
91     <argument ref="authService" />
92     <argument>
93       <bean factory-ref="provider" factory-method="getTokenAuthenticators"/>
94     </argument>
95     <argument>
96       <bean factory-ref="provider" factory-method="getTokenStore"/>
97     </argument>
98     <argument ref="passwordService" />
99   </bean>
100
101   <reference id="customFilterAdapterConfig"
102       interface="org.opendaylight.aaa.filterchain.configuration.CustomFilterAdapterConfiguration"/>
103
104   <bean id="webContextSecurer" class="org.opendaylight.aaa.shiro.web.env.ShiroWebContextSecurer">
105     <argument ref="shiroWebEnvLoader"/>
106   </bean>
107   <service ref="webContextSecurer" interface="org.opendaylight.aaa.web.WebContextSecurer" />
108
109   <reference id="webServer" interface="org.opendaylight.aaa.web.WebServer" />
110
111   <reference id="servletSupport" interface="org.opendaylight.aaa.web.servlet.ServletSupport" />
112
113   <bean id="webInitializer" class="org.opendaylight.aaa.shiro.web.env.WebInitializer" destroy-method="close">
114     <argument ref="webServer"/>
115     <argument ref="idmLightProxy"/>
116     <argument ref="idmStore"/>
117     <argument ref="webContextSecurer"/>
118     <argument ref="servletSupport"/>
119     <argument ref="customFilterAdapterConfig"/>
120   </bean>
121 </blueprint>