<?xml version="1.0" encoding="utf-8"?>
<!--

    Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.

    This program and the accompanying materials are made available under the
    terms of the Eclipse Distribution License v. 1.0, which is available at
    http://www.eclipse.org/org/documents/edl-v10.php.

    SPDX-License-Identifier: BSD-3-Clause

-->

<wsdl:definitions name="SecurityTokenService" targetNamespace="http://tempuri.org/" 
                                              xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
                                              xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" 
                                              xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" 
                                              xmlns:wsap10="http://www.w3.org/2006/05/addressing/wsdl" 
                                              xmlns:i0="http://xmlsoap.org/DAB" 
                                              xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
                                              xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" 
                                              xmlns:tns="http://tempuri.org/" 
                                              xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" 
                                              xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" 
                                              xmlns:wsa10="http://www.w3.org/2005/08/addressing">
	<wsp:Policy wsu:Id="ISecurityTokenService_policy">
		<wsp:ExactlyOne>
			<wsp:All>
				<sp:SymmetricBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
					<wsp:Policy>
						<sp:ProtectionToken>
							<wsp:Policy>
								<sp:X509Token sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Never">
									<wsp:Policy>
										<sp:RequireDerivedKeys />
										<sp:RequireThumbprintReference/>
										<sp:WssX509V3Token10/>
									</wsp:Policy>
								</sp:X509Token>
							</wsp:Policy>
						</sp:ProtectionToken>
						<sp:AlgorithmSuite>
							<wsp:Policy>
								<sp:Basic128/>
							</wsp:Policy>
						</sp:AlgorithmSuite>
						<sp:Layout>
							<wsp:Policy>
								<sp:Lax/>
							</wsp:Policy>
						</sp:Layout>
						<sp:IncludeTimestamp/>
						<sp:EncryptSignature />
						<sp:OnlySignEntireHeadersAndBody/>
					</wsp:Policy>
				</sp:SymmetricBinding>
				<sp:SignedSupportingTokens xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
                                    <wsp:Policy>
                                        <sp:UsernameToken sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
                                            <wsp:Policy>
                                                <sp:WssUsernameToken10/>
                                            </wsp:Policy>
                                        </sp:UsernameToken>
                                    </wsp:Policy>
                                </sp:SignedSupportingTokens>
				<sp:Wss11 xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
					<wsp:Policy>
						<sp:MustSupportRefKeyIdentifier/>
						<sp:MustSupportRefIssuerSerial/>
						<sp:MustSupportRefThumbprint/>
						<sp:MustSupportRefEncryptedKey/>
						<!--sp:RequireSignatureConfirmation/-->
					</wsp:Policy>
				</sp:Wss11>
				<sp:Trust10 xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
					<wsp:Policy>
						<sp:MustSupportIssuedTokens/>
						<sp:RequireClientEntropy/>
						<sp:RequireServerEntropy/>
					</wsp:Policy>
				</sp:Trust10>
                                <!--sunsp:DisableStreamingSecurity xmlns:sunsp="http://schemas.sun.com/2006/03/wss/client"></sunsp:DisableStreamingSecurity-->
                                <sc:KeyStore xmlns:sc="http://schemas.sun.com/2006/03/wss/server" location="$WSIT_HOME/xws-security/etc/sts-keystore.jks" storepass="changeit" alias="wssip"/>
                                <sc:TrustStore xmlns:sc="http://schemas.sun.com/2006/03/wss/server" location="$WSIT_HOME/xws-security/etc/sts-truststore.jks" storepass="changeit"/>

                                <sc:ValidatorConfiguration xmlns:sc="http://schemas.sun.com/2006/03/wss/server">
                                    <sc:Validator name="usernameValidator"  classname="common.SampleUsernamePasswordValidator"/> 
                                    <!--sc:Validator name="usernameValidator"  classname="common.SampleAMUsernamePasswordValidator"/-->
                                </sc:ValidatorConfiguration>
                                <tc:STSConfiguration xmlns:tc="http://schemas.sun.com/ws/2006/05/trust/server" encryptIssuedKey="true" encryptIssuedToken="false">
                                     <tc:LifeTime>36000</tc:LifeTime>
                                     <tc:Contract>com.sun.xml.ws.security.trust.impl.WSTrustContractImpl</tc:Contract>
                                     <tc:Issuer>SunSTS</tc:Issuer>
                                     <tc:ServiceProviders>
                                            <tc:ServiceProvider endPoint="http://localhost:8080/jaxws-fs/simple" >
                                                  <tc:CertAlias>bob</tc:CertAlias>
                                                  <tc:TokenType>http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1</tc:TokenType>
                                            </tc:ServiceProvider>
                                            <tc:ServiceProvider endPoint="default" >
                                                  <tc:CertAlias>bob</tc:CertAlias>
                                                  <tc:TokenType>http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1</tc:TokenType>
                                            </tc:ServiceProvider>
                                            <!-- more service providers -->
                                      </tc:ServiceProviders>
                                </tc:STSConfiguration>
				<wsap10:UsingAddressing/>
			</wsp:All>
		</wsp:ExactlyOne>
	</wsp:Policy>
	<wsp:Policy wsu:Id="ISecurityTokenService_IssueToken_Input_policy">
		<wsp:ExactlyOne>
			<wsp:All>
				<sp:SignedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
					<sp:Body/>
					<sp:Header Name="To" Namespace="http://www.w3.org/2005/08/addressing"/>
					<sp:Header Name="From" Namespace="http://www.w3.org/2005/08/addressing"/>
					<sp:Header Name="FaultTo" Namespace="http://www.w3.org/2005/08/addressing"/>
					<sp:Header Name="ReplyTo" Namespace="http://www.w3.org/2005/08/addressing"/>
					<sp:Header Name="MessageID" Namespace="http://www.w3.org/2005/08/addressing"/>
					<sp:Header Name="RelatesTo" Namespace="http://www.w3.org/2005/08/addressing"/>
					<sp:Header Name="Action" Namespace="http://www.w3.org/2005/08/addressing"/>
				</sp:SignedParts>
				<sp:EncryptedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
					<sp:Body/>
				</sp:EncryptedParts>
			</wsp:All>
		</wsp:ExactlyOne>
	</wsp:Policy>
	<wsp:Policy wsu:Id="ISecurityTokenService_IssueToken_Output_policy">
		<wsp:ExactlyOne>
			<wsp:All>
				<sp:SignedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
					<sp:Body/>
					<sp:Header Name="To" Namespace="http://www.w3.org/2005/08/addressing"/>
					<sp:Header Name="From" Namespace="http://www.w3.org/2005/08/addressing"/>
					<sp:Header Name="FaultTo" Namespace="http://www.w3.org/2005/08/addressing"/>
					<sp:Header Name="ReplyTo" Namespace="http://www.w3.org/2005/08/addressing"/>
					<sp:Header Name="MessageID" Namespace="http://www.w3.org/2005/08/addressing"/>
					<sp:Header Name="RelatesTo" Namespace="http://www.w3.org/2005/08/addressing"/>
					<sp:Header Name="Action" Namespace="http://www.w3.org/2005/08/addressing"/>
				</sp:SignedParts>
				<sp:EncryptedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
					<sp:Body/>
				</sp:EncryptedParts>
			</wsp:All>
		</wsp:ExactlyOne>
	</wsp:Policy>
	<wsdl:types>
		<xsd:schema targetNamespace="http://tempuri.org/Imports">
			<xsd:import schemaLocation="sts_schema.xsd" namespace="http://schemas.message.com/Message"/>
		</xsd:schema>
	</wsdl:types>
	<wsdl:message name="ISecurityTokenService_IssueToken_InputMessage">
		<wsdl:part name="rstMessage" type="q1:MessageBody" xmlns:q1="http://schemas.message.com/Message"/>
	</wsdl:message>
	<wsdl:message name="ISecurityTokenService_IssueToken_OutputMessage">
		<wsdl:part name="IssueTokenResult" type="q2:MessageBody" xmlns:q2="http://schemas.message.com/Message"/>
	</wsdl:message>
	<wsdl:portType name="ISecurityTokenService">
		<wsdl:operation name="IssueToken">
			<wsdl:input wsap10:Action="http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Issue" message="tns:ISecurityTokenService_IssueToken_InputMessage"/>
			<wsdl:output wsap10:Action="http://schemas.xmlsoap.org/ws/2005/02/trust/RSTR/Issue" message="tns:ISecurityTokenService_IssueToken_OutputMessage"/>
		</wsdl:operation>
	</wsdl:portType>
	<wsdl:binding name="ISecurityTokenService_Binding" type="tns:ISecurityTokenService">
		<wsp:PolicyReference URI="#ISecurityTokenService_policy"/>
		<soap12:binding transport="http://schemas.xmlsoap.org/soap/http"/>
		<wsdl:operation name="IssueToken">
			<soap12:operation soapAction="http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Issue" style="document"/>
			<wsdl:input>
				<wsp:PolicyReference URI="#ISecurityTokenService_IssueToken_Input_policy"/>
				<soap12:body use="literal"/>
			</wsdl:input>
			<wsdl:output>
				<wsp:PolicyReference URI="#ISecurityTokenService_IssueToken_Output_policy"/>
				<soap12:body use="literal"/>
			</wsdl:output>
		</wsdl:operation>
	</wsdl:binding>
	<wsdl:service name="SecurityTokenService">
		<wsdl:port name="ISecurityTokenService_Port" binding="tns:ISecurityTokenService_Binding">
			<soap12:address location="http://localhost:8080/jaxws-sts/sts"/>
		</wsdl:port>
	</wsdl:service>
</wsdl:definitions>
