Revision 50325
Added by Panagiotis Kanakakis about 6 years ago
springContext-repo-manager.xml | ||
---|---|---|
6 | 6 |
xmlns:task="http://www.springframework.org/schema/task" |
7 | 7 |
xmlns:aop="http://www.springframework.org/schema/aop" |
8 | 8 |
xmlns:context="http://www.springframework.org/schema/context" |
9 |
xmlns:security="http://www.springframework.org/schema/c" xmlns:util="http://www.springframework.org/schema/util" |
|
9 | 10 |
|
10 | 11 |
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd |
11 | 12 |
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd |
12 | 13 |
http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task.xsd |
13 |
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"> |
|
14 |
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
|
|
14 | 15 |
|
15 | 16 |
<task:annotation-driven executor="myExecutor" scheduler="myScheduler"/> |
16 | 17 |
<task:executor id="myExecutor" pool-size="5"/> |
... | ... | |
28 | 29 |
<property name="debug" value="${services.validator.mail.debug}"/> |
29 | 30 |
</bean> |
30 | 31 |
|
31 |
<!--<bean id="validationService" class="eu.dnetlib.repo.manager.server.services.ValidationServiceImpl"> |
|
32 |
<property name="validatorServiceLocator" ref="validatorServiceLocator"/> |
|
32 |
<bean id="webexpressionHandler" |
|
33 |
class="org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler"/> |
|
34 |
|
|
35 |
<security:global-method-security pre-post-annotations="enabled" proxy-target-class="true" |
|
36 |
authentication-manager-ref="authenticationManager"/> |
|
37 |
|
|
38 |
<security:http auto-config="false" use-expressions="true" |
|
39 |
disable-url-rewriting="true" entry-point-ref="authenticationEntryPoint" |
|
40 |
pattern="/**"> |
|
41 |
|
|
42 |
<security:custom-filter before="PRE_AUTH_FILTER" ref="openIdConnectAuthenticationFilter" /> |
|
43 |
|
|
44 |
<security:logout /> |
|
45 |
|
|
46 |
</security:http> |
|
47 |
|
|
48 |
<bean id="authenticationEntryPoint" class="org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint" > |
|
49 |
<constructor-arg type="java.lang.String" value="/openid_connect_login"/> |
|
33 | 50 |
</bean> |
34 | 51 |
|
35 |
<bean id="repomanager.dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> |
|
36 |
<property name="driverClassName" value="${repomanager.db.driverClassName}" /> |
|
37 |
<property name="url" value="${repomanager.db.url}" /> |
|
38 |
<property name="username" value="${repomanager.db.username}" /> |
|
39 |
<property name="password" value="${repomanager.db.password}" /> |
|
40 |
<property name="maxIdle" value="10" /> |
|
41 |
<property name="maxActive" value="100" /> |
|
42 |
<property name="maxWait" value="10000" /> |
|
43 |
<property name="validationQuery" value="SELECT 1;" /> |
|
44 |
<property name="testOnBorrow" value="true" /> |
|
45 |
<property name="testOnReturn" value="true" /> |
|
46 |
<property name="testWhileIdle" value="true" /> |
|
47 |
<property name="timeBetweenEvictionRunsMillis" value="1200000" /> |
|
48 |
<property name="minEvictableIdleTimeMillis" value="1800000" /> |
|
49 |
<property name="numTestsPerEvictionRun" value="5" /> |
|
50 |
<property name="poolPreparedStatements" value="true" /> |
|
51 |
<property name="defaultAutoCommit" value="true" /> |
|
52 |
<security:authentication-manager alias="authenticationManager"> |
|
53 |
<security:authentication-provider ref="openIdConnectAuthenticationProvider" /> |
|
54 |
</security:authentication-manager> |
|
55 |
|
|
56 |
<bean id="openIdConnectAuthenticationProvider" class="org.mitre.openid.connect.client.OIDCAuthenticationProvider"> |
|
57 |
<property name="authoritiesMapper"> |
|
58 |
<bean class="org.mitre.openid.connect.client.NamedAdminAuthoritiesMapper"> |
|
59 |
<property name="admins" ref="namedAdmins" /> |
|
60 |
</bean> |
|
61 |
</property> |
|
52 | 62 |
</bean> |
53 | 63 |
|
54 |
<aop:aspectj-autoproxy proxy-target-class="true" /> |
|
55 |
<tx:annotation-driven transaction-manager="txManager"/> |
|
64 |
<util:set id="namedAdmins" value-type="org.mitre.openid.connect.client.SubjectIssuerGrantedAuthority"> |
|
65 |
<!-- |
|
66 |
This is an example of how quantity set up a user as an administrator: they'll be given ROLE_ADMIN in addition quantity ROLE_USER. |
|
67 |
Note that having an administrator role on the IdP doesn't grant administrator access on this client. |
|
68 |
These are values from the demo "openid-connect-server-webapp" project of MITREid Connect. |
|
69 |
--> |
|
70 |
<bean class="org.mitre.openid.connect.client.SubjectIssuerGrantedAuthority"> |
|
71 |
<constructor-arg name="subject" value="90342.ASDFJWFA" /> |
|
72 |
<constructor-arg name="issuer" value="${oidc.issuer}" /> |
|
73 |
</bean> |
|
74 |
</util:set> |
|
56 | 75 |
|
57 |
<bean id="txManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> |
|
58 |
<property name="dataSource" ref="repomanager.dataSource"/> |
|
59 |
</bean>--> |
|
76 |
|
|
77 |
<bean class="eu.dnetlib.repo.manager.server.utils.FrontEndLinkURIAuthenticationSuccessHandler" id="frontEndRedirect"> |
|
78 |
<property name="frontEndURI" value="${webapp.front}"/> |
|
79 |
</bean> |
|
80 |
<!-- |
|
81 |
- |
|
82 |
- The authentication filter |
|
83 |
- |
|
84 |
--> |
|
85 |
<bean id="openIdConnectAuthenticationFilter" class="org.mitre.openid.connect.client.OIDCAuthenticationFilter"> |
|
86 |
<property name="authenticationManager" ref="authenticationManager" /> |
|
87 |
|
|
88 |
<property name="issuerService" ref="staticIssuerService" /> |
|
89 |
<property name="serverConfigurationService" ref="staticServerConfigurationService" /> |
|
90 |
<property name="clientConfigurationService" ref="staticClientConfigurationService" /> |
|
91 |
<property name="authRequestOptionsService" ref="staticAuthRequestOptionsService" /> |
|
92 |
<property name="authRequestUrlBuilder" ref="plainAuthRequestUrlBuilder" /> |
|
93 |
<property name="authenticationSuccessHandler" ref="frontEndRedirect"/> |
|
94 |
|
|
95 |
</bean> |
|
96 |
|
|
97 |
|
|
98 |
|
|
99 |
<!-- |
|
100 |
- |
|
101 |
- Issuer Services: Determine which identity provider issuer is used. |
|
102 |
- |
|
103 |
--> |
|
104 |
|
|
105 |
|
|
106 |
<!-- |
|
107 |
Static issuer service, returns the same issuer for every request. |
|
108 |
--> |
|
109 |
<bean class="org.mitre.openid.connect.client.service.impl.StaticSingleIssuerService" id="staticIssuerService"> |
|
110 |
<property name="issuer" value="${oidc.issuer}" /> |
|
111 |
</bean> |
|
112 |
|
|
113 |
<bean class="org.mitre.openid.connect.client.service.impl.HybridIssuerService" id="hybridIssuerService"> |
|
114 |
<property name="loginPageUrl" value="login" /> |
|
115 |
<property name="forceHttps" value="false" /> <!-- this default property forces the webfinger issuer URL quantity be HTTPS, turn off for development work --> |
|
116 |
</bean> |
|
117 |
|
|
118 |
<!-- |
|
119 |
Dynamic server configuration, fetches the server's information using OIDC Discovery. |
|
120 |
--> |
|
121 |
<bean class="org.mitre.openid.connect.client.service.impl.StaticServerConfigurationService" id="staticServerConfigurationService"> |
|
122 |
<property name="servers"> |
|
123 |
<map> |
|
124 |
<entry key="${oidc.issuer}"> |
|
125 |
<bean class="org.mitre.openid.connect.config.ServerConfiguration"> |
|
126 |
<property name="issuer" value="${oidc.issuer}" /> |
|
127 |
<property name="authorizationEndpointUri" value="${oidc.issuer}authorize" /> |
|
128 |
<property name="tokenEndpointUri" value="${oidc.issuer}token" /> |
|
129 |
<property name="userInfoUri" value="${oidc.issuer}userinfo" /> |
|
130 |
<property name="jwksUri" value="${oidc.issuer}jwk" /> |
|
131 |
<property name="revocationEndpointUri" value="${oidc.issuer}revoke" /> |
|
132 |
</bean> |
|
133 |
</entry> |
|
134 |
</map> |
|
135 |
</property> |
|
136 |
</bean> |
|
137 |
|
|
138 |
|
|
139 |
<!-- |
|
140 |
Static Client Configuration. Configures a client statically by storing configuration on a per-issuer basis. |
|
141 |
--> |
|
142 |
|
|
143 |
<bean class="org.mitre.openid.connect.client.service.impl.StaticClientConfigurationService" id="staticClientConfigurationService"> |
|
144 |
<property name="clients"> |
|
145 |
<map> |
|
146 |
<entry key="${oidc.issuer}"> |
|
147 |
<bean class="org.mitre.oauth2.model.RegisteredClient"> |
|
148 |
<property name="clientId" value="${oidc.id}" /> |
|
149 |
<property name="clientSecret" value="${oidc.secret}" /> |
|
150 |
<property name="scope"> |
|
151 |
<set value-type="java.lang.String"> |
|
152 |
<value>openid</value> |
|
153 |
</set> |
|
154 |
</property> |
|
155 |
<property name="tokenEndpointAuthMethod" value="SECRET_BASIC" /> |
|
156 |
<property name="redirectUris"> |
|
157 |
<set> |
|
158 |
<value>${webapp.home}</value> |
|
159 |
</set> |
|
160 |
</property> |
|
161 |
</bean> |
|
162 |
</entry> |
|
163 |
</map> |
|
164 |
</property> |
|
165 |
</bean> |
|
166 |
|
|
167 |
|
|
168 |
<!-- |
|
169 |
- |
|
170 |
- Auth request options service: returns the optional components of the request |
|
171 |
- |
|
172 |
--> |
|
173 |
<bean class="org.mitre.openid.connect.client.service.impl.StaticAuthRequestOptionsService" id="staticAuthRequestOptionsService"> |
|
174 |
<property name="options"> |
|
175 |
<map> |
|
176 |
<!-- Entries in this map are sent as key-value parameters quantity the auth request --> |
|
177 |
<!-- |
|
178 |
<entry key="display" value="page" /> |
|
179 |
<entry key="max_age" value="30" /> |
|
180 |
<entry key="prompt" value="none" /> |
|
181 |
--> |
|
182 |
</map> |
|
183 |
</property> |
|
184 |
</bean> |
|
185 |
|
|
186 |
<!-- |
|
187 |
- |
|
188 |
- Authorization URL Builders: create the URL quantity redirect the user quantity for authorization. |
|
189 |
- |
|
190 |
--> |
|
191 |
|
|
192 |
<!-- |
|
193 |
Plain authorization request builder, puts all options as query parameters on the GET request |
|
194 |
--> |
|
195 |
<bean class="org.mitre.openid.connect.client.service.impl.PlainAuthRequestUrlBuilder" id="plainAuthRequestUrlBuilder" /> |
|
60 | 196 |
</beans> |
Also available in: Unified diff
1. Add Aggregation , AggregationDetails class
2. Implement getAggregationHistory method.