[CXF-5697] Some minor updates for WHICH_JAR
[cxf.git] / services / sts / systests / basic / src / test / resources / org / apache / cxf / systest / sts / rest / cxf-rest-sts.xml
1 <?xml version="1.0"?>
2 <!--
3 Licensed to the Apache Software Foundation (ASF) under one
4 or more contributor license agreements. See the NOTICE file
5 distributed with this work for additional information
6 regarding copyright ownership. The ASF licenses this file
7 to you under the Apache License, Version 2.0 (the
8 "License"); you may not use this file except in compliance
9 with the License. You may obtain a copy of the License at
10
11 http://www.apache.org/licenses/LICENSE-2.0
12
13 Unless required by applicable law or agreed to in writing,
14 software distributed under the License is distributed on an
15 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 KIND, either express or implied. See the License for the
17 specific language governing permissions and limitations
18 under the License.
19 -->
20 <beans xmlns="http://www.springframework.org/schema/beans" xmlns:cxf="http://cxf.apache.org/core" xmlns:jaxws="http://cxf.apache.org/jaxws" xmlns:sec="http://cxf.apache.org/configuration/security" xmlns:httpj="http://cxf.apache.org/transports/http-jetty/configuration" xmlns:test="http://apache.org/hello_world_soap_http" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util" xmlns:jaxrs="http://cxf.apache.org/jaxrs" xsi:schemaLocation=" http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd http://cxf.apache.org/configuration/security http://cxf.apache.org/schemas/configuration/security.xsd http://cxf.apache.org/transports/http-jetty/configuration http://cxf.apache.org/schemas/configuration/http-jetty.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd">
21
22 <import resource="classpath:META-INF/cxf/cxf.xml"/>
23
24 <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
25 <cxf:bus>
26 <cxf:features>
27 <cxf:logging/>
28 </cxf:features>
29 </cxf:bus>
30
31 <bean id="hokDelegationHandler" class="org.apache.cxf.sts.token.delegation.HOKDelegationHandler"/>
32 <bean id="utDelegationHandler" class="org.apache.cxf.sts.token.delegation.UsernameTokenDelegationHandler"/>
33
34 <util:list id="delegationHandlers">
35 <ref bean="hokDelegationHandler"/>
36 <ref bean="utDelegationHandler"/>
37 </util:list>
38
39 <bean id="transportIssueDelegate" class="org.apache.cxf.sts.operation.TokenIssueOperation">
40 <property name="tokenProviders" ref="transportTokenProviders"/>
41 <property name="tokenValidators" ref="transportTokenValidators"/>
42 <property name="services" ref="transportService"/>
43 <property name="stsProperties" ref="transportSTSProperties"/>
44 <property name="delegationHandlers" ref="delegationHandlers"/>
45 <property name="claimsManager" ref="claimsManager"/>
46 <property name="tokenStore" ref="defaultTokenStore"/>
47 </bean>
48 <bean id="transportValidateDelegate" class="org.apache.cxf.sts.operation.TokenValidateOperation">
49 <property name="tokenProviders" ref="transportTokenProviders"/>
50 <property name="tokenValidators" ref="transportTokenValidators"/>
51 <property name="stsProperties" ref="transportSTSProperties"/>
52 <property name="tokenStore" ref="defaultTokenStore"/>
53 </bean>
54 <bean id="transportRenewDelegate" class="org.apache.cxf.sts.operation.TokenRenewOperation">
55 <property name="tokenRenewers" ref="transportTokenRenewers"/>
56 <property name="tokenValidators" ref="transportTokenValidators"/>
57 <property name="stsProperties" ref="transportSTSProperties"/>
58 <property name="tokenStore" ref="defaultTokenStore"/>
59 </bean>
60 <bean id="defaultTokenStore" class="org.apache.cxf.sts.cache.DefaultInMemoryTokenStore">
61 </bean>
62 <bean id="transportUTTokenValidator" class="org.apache.cxf.sts.token.validator.UsernameTokenValidator">
63 </bean>
64 <util:list id="transportTokenValidators">
65 <ref bean="transportSamlTokenValidator"/>
66 <ref bean="transportUTTokenValidator"/>
67 <ref bean="transportJWTTokenValidator"/>
68 </util:list>
69 <util:list id="transportTokenProviders">
70 <ref bean="transportSamlTokenProvider"/>
71 <ref bean="transportJWTTokenProvider"/>
72 </util:list>
73 <util:list id="transportTokenRenewers">
74 <ref bean="transportSamlTokenRenewer"/>
75 </util:list>
76 <bean id="transportSamlTokenValidator" class="org.apache.cxf.sts.token.validator.SAMLTokenValidator">
77 </bean>
78 <bean id="transportSamlTokenProvider" class="org.apache.cxf.sts.token.provider.SAMLTokenProvider">
79 </bean>
80 <bean id="transportJWTTokenProvider" class="org.apache.cxf.sts.token.provider.jwt.JWTTokenProvider">
81 </bean>
82 <bean id="transportJWTTokenValidator" class="org.apache.cxf.sts.token.validator.jwt.JWTTokenValidator">
83 </bean>
84 <bean id="transportSamlTokenRenewer" class="org.apache.cxf.sts.token.renewer.SAMLTokenRenewer">
85 <property name="verifyProofOfPossession" value="false"/>
86 <property name="allowRenewalAfterExpiry" value="true"/>
87 </bean>
88 <bean id="transportService" class="org.apache.cxf.sts.service.StaticService">
89 <property name="endpoints" ref="transportEndpoints"/>
90 </bean>
91 <util:list id="transportEndpoints">
92 <value>https://localhost:(\d)*/doubleit/services/doubleittransport.*
93 </value>
94 </util:list>
95 <bean id="transportSTSProperties" class="org.apache.cxf.sts.StaticSTSProperties">
96 <property name="signaturePropertiesFile" value="stsKeystore.properties"/>
97 <property name="signatureUsername" value="mystskey"/>
98 <property name="callbackHandlerClass" value="org.apache.cxf.systest.sts.common.CommonCallbackHandler"/>
99 <property name="encryptionPropertiesFile" value="stsKeystore.properties"/>
100 <property name="issuer" value="DoubleItSTSIssuer"/>
101 <property name="encryptionUsername" value="myservicekey"/>
102 </bean>
103
104 <bean id="claimsManager" class="org.apache.cxf.sts.claims.ClaimsManager">
105 <property name="claimHandlers" ref="customClaimsHandler"/>
106 </bean>
107 <bean id="customClaimsHandler" class="org.apache.cxf.systest.sts.deployment.CustomClaimsHandler">
108 </bean>
109
110 <bean id="restSTS" class="org.apache.cxf.sts.rest.RESTSecurityTokenServiceImpl">
111 <property name="issueSingleOperation" ref="transportIssueDelegate" />
112 <property name="validateOperation" ref="transportValidateDelegate" />
113 <property name="renewOperation" ref="transportRenewDelegate"/>
114 </bean>
115
116 <bean id="jsonProvider" class="com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider" />
117
118 <jaxrs:server id="stsRESTService"
119 depends-on="ClientAuthHttpsSettings"
120 address="https://localhost:${testutil.ports.STSRESTServer}/SecurityTokenService">
121 <jaxrs:serviceBeans>
122 <ref bean="restSTS" />
123 </jaxrs:serviceBeans>
124 <jaxrs:providers>
125 <ref bean="jsonProvider" />
126 </jaxrs:providers>
127 <jaxrs:extensionMappings>
128 <entry key="json" value="application/json;charset=UTF-8" />
129 <entry key="xml" value="application/xml;charset=UTF-8" />
130 </jaxrs:extensionMappings>
131 </jaxrs:server>
132
133 <httpj:engine-factory id="ClientAuthHttpsSettings" bus="cxf">
134 <httpj:engine port="${testutil.ports.STSRESTServer}">
135 <httpj:tlsServerParameters>
136 <sec:keyManagers keyPassword="skpass">
137 <sec:keyStore type="jks" password="sspass" resource="keys/servicestore.jks"/>
138 </sec:keyManagers>
139 <sec:trustManagers>
140 <sec:keyStore type="jks" password="stsspass" resource="keys/stsstore.jks"/>
141 </sec:trustManagers>
142 <sec:clientAuthentication want="true" required="true"/>
143 </httpj:tlsServerParameters>
144 </httpj:engine>
145 </httpj:engine-factory>
146 </beans>