ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1799161 [29/37] - in /webservices/website/wss4j: ./ apidocs/ apidocs/org/apache/wss4j/binding/wss10/ apidocs/org/apache/wss4j/binding/wss10/class-use/ apidocs/org/apache/wss4j/binding/wss11/ apidocs/org/apache/wss4j/binding/wss11/class-use...
Date Mon, 19 Jun 2017 09:03:04 GMT
Modified: webservices/website/wss4j/xref-test/org/apache/wss4j/dom/saml/SamlTokenActionTest.html
URL: http://svn.apache.org/viewvc/webservices/website/wss4j/xref-test/org/apache/wss4j/dom/saml/SamlTokenActionTest.html?rev=1799161&r1=1799160&r2=1799161&view=diff
==============================================================================
--- webservices/website/wss4j/xref-test/org/apache/wss4j/dom/saml/SamlTokenActionTest.html
(original)
+++ webservices/website/wss4j/xref-test/org/apache/wss4j/dom/saml/SamlTokenActionTest.html
Mon Jun 19 09:02:30 2017
@@ -112,98 +112,135 @@
 <a class="jxr_linenumber" name="L104" href="#L104">104</a>     }
 <a class="jxr_linenumber" name="L105" href="#L105">105</a> 
 <a class="jxr_linenumber" name="L106" href="#L106">106</a>     @Test
-<a class="jxr_linenumber" name="L107" href="#L107">107</a>     <strong class="jxr_keyword">public</strong>
<strong class="jxr_keyword">void</strong> testSignedAssertionAction() <strong
class="jxr_keyword">throws</strong> Exception {
+<a class="jxr_linenumber" name="L107" href="#L107">107</a>     <strong class="jxr_keyword">public</strong>
<strong class="jxr_keyword">void</strong> testAssertionActionWithSAAJ() <strong
class="jxr_keyword">throws</strong> Exception {
 <a class="jxr_linenumber" name="L108" href="#L108">108</a>         <strong
class="jxr_keyword">final</strong> WSSConfig cfg = WSSConfig.getNewInstance();
 <a class="jxr_linenumber" name="L109" href="#L109">109</a>         <strong
class="jxr_keyword">final</strong> RequestData reqData = <strong class="jxr_keyword">new</strong>
RequestData();
 <a class="jxr_linenumber" name="L110" href="#L110">110</a>         reqData.setWssConfig(cfg);
-<a class="jxr_linenumber" name="L111" href="#L111">111</a> 
-<a class="jxr_linenumber" name="L112" href="#L112">112</a>         CallbackHandler
callbackHandler = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/wss4j/dom/common/KeystoreCallbackHandler.html">KeystoreCallbackHandler</a>();
-<a class="jxr_linenumber" name="L113" href="#L113">113</a> 
-<a class="jxr_linenumber" name="L114" href="#L114">114</a>         <a href="../../../../../org/apache/wss4j/dom/common/SAML1CallbackHandler.html">SAML1CallbackHandler</a>
samlCallbackHandler = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/wss4j/dom/common/SAML1CallbackHandler.html">SAML1CallbackHandler</a>();
-<a class="jxr_linenumber" name="L115" href="#L115">115</a>         samlCallbackHandler.setStatement(SAML1CallbackHandler.Statement.AUTHN);
-<a class="jxr_linenumber" name="L116" href="#L116">116</a>         samlCallbackHandler.setIssuer(<span
class="jxr_string">"www.example.com"</span>);
-<a class="jxr_linenumber" name="L117" href="#L117">117</a>         samlCallbackHandler.setIssuerCrypto(crypto);
-<a class="jxr_linenumber" name="L118" href="#L118">118</a>         samlCallbackHandler.setIssuerName(<span
class="jxr_string">"wss40"</span>);
-<a class="jxr_linenumber" name="L119" href="#L119">119</a>         samlCallbackHandler.setIssuerPassword(<span
class="jxr_string">"security"</span>);
-<a class="jxr_linenumber" name="L120" href="#L120">120</a> 
-<a class="jxr_linenumber" name="L121" href="#L121">121</a>         java.util.Map&lt;String,
Object&gt; config = <strong class="jxr_keyword">new</strong> java.util.TreeMap&lt;String,
Object&gt;();
-<a class="jxr_linenumber" name="L122" href="#L122">122</a>         config.put(WSHandlerConstants.PW_CALLBACK_REF,
callbackHandler);
-<a class="jxr_linenumber" name="L123" href="#L123">123</a>         config.put(WSHandlerConstants.SAML_CALLBACK_REF,
samlCallbackHandler);
-<a class="jxr_linenumber" name="L124" href="#L124">124</a>         reqData.setMsgContext(config);
-<a class="jxr_linenumber" name="L125" href="#L125">125</a> 
-<a class="jxr_linenumber" name="L126" href="#L126">126</a>         <strong
class="jxr_keyword">final</strong> Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
-<a class="jxr_linenumber" name="L127" href="#L127">127</a>         <a href="../../../../../org/apache/wss4j/dom/common/CustomHandler.html">CustomHandler</a>
handler = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/wss4j/dom/common/CustomHandler.html">CustomHandler</a>();
-<a class="jxr_linenumber" name="L128" href="#L128">128</a>         HandlerAction
action = <strong class="jxr_keyword">new</strong> HandlerAction(WSConstants.ST_SIGNED);
-<a class="jxr_linenumber" name="L129" href="#L129">129</a>         handler.send(
-<a class="jxr_linenumber" name="L130" href="#L130">130</a>             doc,
-<a class="jxr_linenumber" name="L131" href="#L131">131</a>             reqData,
-<a class="jxr_linenumber" name="L132" href="#L132">132</a>             Collections.singletonList(action),
-<a class="jxr_linenumber" name="L133" href="#L133">133</a>             <strong
class="jxr_keyword">true</strong>
-<a class="jxr_linenumber" name="L134" href="#L134">134</a>         );
-<a class="jxr_linenumber" name="L135" href="#L135">135</a>         <strong
class="jxr_keyword">if</strong> (LOG.isDebugEnabled()) {
-<a class="jxr_linenumber" name="L136" href="#L136">136</a>             String
outputString = XMLUtils.prettyDocumentToString(doc);
-<a class="jxr_linenumber" name="L137" href="#L137">137</a>             LOG.debug(outputString);
-<a class="jxr_linenumber" name="L138" href="#L138">138</a>         }
-<a class="jxr_linenumber" name="L139" href="#L139">139</a> 
-<a class="jxr_linenumber" name="L140" href="#L140">140</a>         verify(doc,
callbackHandler);
-<a class="jxr_linenumber" name="L141" href="#L141">141</a>     }
-<a class="jxr_linenumber" name="L142" href="#L142">142</a> 
+<a class="jxr_linenumber" name="L111" href="#L111">111</a>         reqData.setUsername(<span
class="jxr_string">"wss40"</span>);
+<a class="jxr_linenumber" name="L112" href="#L112">112</a> 
+<a class="jxr_linenumber" name="L113" href="#L113">113</a>         CallbackHandler
callbackHandler = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/wss4j/dom/common/KeystoreCallbackHandler.html">KeystoreCallbackHandler</a>();
+<a class="jxr_linenumber" name="L114" href="#L114">114</a> 
+<a class="jxr_linenumber" name="L115" href="#L115">115</a>         <a href="../../../../../org/apache/wss4j/dom/common/SAML1CallbackHandler.html">SAML1CallbackHandler</a>
samlCallbackHandler = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/wss4j/dom/common/SAML1CallbackHandler.html">SAML1CallbackHandler</a>();
+<a class="jxr_linenumber" name="L116" href="#L116">116</a>         samlCallbackHandler.setStatement(SAML1CallbackHandler.Statement.AUTHN);
+<a class="jxr_linenumber" name="L117" href="#L117">117</a>         samlCallbackHandler.setIssuer(<span
class="jxr_string">"www.example.com"</span>);
+<a class="jxr_linenumber" name="L118" href="#L118">118</a> 
+<a class="jxr_linenumber" name="L119" href="#L119">119</a>         java.util.Map&lt;String,
Object&gt; config = <strong class="jxr_keyword">new</strong> java.util.TreeMap&lt;String,
Object&gt;();
+<a class="jxr_linenumber" name="L120" href="#L120">120</a>         config.put(WSHandlerConstants.SIG_PROP_FILE,
<span class="jxr_string">"wss40.properties"</span>);
+<a class="jxr_linenumber" name="L121" href="#L121">121</a>         config.put(WSHandlerConstants.PW_CALLBACK_REF,
callbackHandler);
+<a class="jxr_linenumber" name="L122" href="#L122">122</a>         config.put(WSHandlerConstants.SAML_CALLBACK_REF,
samlCallbackHandler);
+<a class="jxr_linenumber" name="L123" href="#L123">123</a>         reqData.setMsgContext(config);
+<a class="jxr_linenumber" name="L124" href="#L124">124</a> 
+<a class="jxr_linenumber" name="L125" href="#L125">125</a>         <strong
class="jxr_keyword">final</strong> Document doc = SOAPUtil.toSAAJSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
+<a class="jxr_linenumber" name="L126" href="#L126">126</a>         <a href="../../../../../org/apache/wss4j/dom/common/CustomHandler.html">CustomHandler</a>
handler = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/wss4j/dom/common/CustomHandler.html">CustomHandler</a>();
+<a class="jxr_linenumber" name="L127" href="#L127">127</a>         HandlerAction
action = <strong class="jxr_keyword">new</strong> HandlerAction(WSConstants.ST_UNSIGNED);
+<a class="jxr_linenumber" name="L128" href="#L128">128</a>         handler.send(
+<a class="jxr_linenumber" name="L129" href="#L129">129</a>             doc,
+<a class="jxr_linenumber" name="L130" href="#L130">130</a>             reqData,
+<a class="jxr_linenumber" name="L131" href="#L131">131</a>             Collections.singletonList(action),
+<a class="jxr_linenumber" name="L132" href="#L132">132</a>             <strong
class="jxr_keyword">true</strong>
+<a class="jxr_linenumber" name="L133" href="#L133">133</a>         );
+<a class="jxr_linenumber" name="L134" href="#L134">134</a>         <strong
class="jxr_keyword">if</strong> (LOG.isDebugEnabled()) {
+<a class="jxr_linenumber" name="L135" href="#L135">135</a>             String
outputString = XMLUtils.prettyDocumentToString(doc);
+<a class="jxr_linenumber" name="L136" href="#L136">136</a>             LOG.debug(outputString);
+<a class="jxr_linenumber" name="L137" href="#L137">137</a>         }
+<a class="jxr_linenumber" name="L138" href="#L138">138</a> 
+<a class="jxr_linenumber" name="L139" href="#L139">139</a>         verify(doc,
callbackHandler);
+<a class="jxr_linenumber" name="L140" href="#L140">140</a>     }
+<a class="jxr_linenumber" name="L141" href="#L141">141</a>     
+<a class="jxr_linenumber" name="L142" href="#L142">142</a>     
 <a class="jxr_linenumber" name="L143" href="#L143">143</a>     @Test
-<a class="jxr_linenumber" name="L144" href="#L144">144</a>     <strong class="jxr_keyword">public</strong>
<strong class="jxr_keyword">void</strong> testAssertionWithSignatureAction() <strong
class="jxr_keyword">throws</strong> Exception {
+<a class="jxr_linenumber" name="L144" href="#L144">144</a>     <strong class="jxr_keyword">public</strong>
<strong class="jxr_keyword">void</strong> testSignedAssertionAction() <strong
class="jxr_keyword">throws</strong> Exception {
 <a class="jxr_linenumber" name="L145" href="#L145">145</a>         <strong
class="jxr_keyword">final</strong> WSSConfig cfg = WSSConfig.getNewInstance();
 <a class="jxr_linenumber" name="L146" href="#L146">146</a>         <strong
class="jxr_keyword">final</strong> RequestData reqData = <strong class="jxr_keyword">new</strong>
RequestData();
 <a class="jxr_linenumber" name="L147" href="#L147">147</a>         reqData.setWssConfig(cfg);
-<a class="jxr_linenumber" name="L148" href="#L148">148</a>         reqData.setUsername(<span
class="jxr_string">"wss40"</span>);
-<a class="jxr_linenumber" name="L149" href="#L149">149</a> 
-<a class="jxr_linenumber" name="L150" href="#L150">150</a>         CallbackHandler
callbackHandler = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/wss4j/dom/common/KeystoreCallbackHandler.html">KeystoreCallbackHandler</a>();
-<a class="jxr_linenumber" name="L151" href="#L151">151</a> 
-<a class="jxr_linenumber" name="L152" href="#L152">152</a>         <a href="../../../../../org/apache/wss4j/dom/common/SAML1CallbackHandler.html">SAML1CallbackHandler</a>
samlCallbackHandler = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/wss4j/dom/common/SAML1CallbackHandler.html">SAML1CallbackHandler</a>();
-<a class="jxr_linenumber" name="L153" href="#L153">153</a>         samlCallbackHandler.setStatement(SAML1CallbackHandler.Statement.AUTHN);
-<a class="jxr_linenumber" name="L154" href="#L154">154</a>         samlCallbackHandler.setIssuer(<span
class="jxr_string">"www.example.com"</span>);
-<a class="jxr_linenumber" name="L155" href="#L155">155</a> 
-<a class="jxr_linenumber" name="L156" href="#L156">156</a>         java.util.Map&lt;String,
Object&gt; config = <strong class="jxr_keyword">new</strong> java.util.TreeMap&lt;String,
Object&gt;();
-<a class="jxr_linenumber" name="L157" href="#L157">157</a>         config.put(WSHandlerConstants.SIG_PROP_FILE,
<span class="jxr_string">"wss40.properties"</span>);
-<a class="jxr_linenumber" name="L158" href="#L158">158</a>         config.put(WSHandlerConstants.PW_CALLBACK_REF,
callbackHandler);
-<a class="jxr_linenumber" name="L159" href="#L159">159</a>         config.put(WSHandlerConstants.SAML_CALLBACK_REF,
samlCallbackHandler);
-<a class="jxr_linenumber" name="L160" href="#L160">160</a>         config.put(WSHandlerConstants.SIGNATURE_PARTS,
<span class="jxr_string">"{}{"</span> + WSConstants.SAML_NS + <span class="jxr_string">"}Assertion;"</span>);
+<a class="jxr_linenumber" name="L148" href="#L148">148</a> 
+<a class="jxr_linenumber" name="L149" href="#L149">149</a>         CallbackHandler
callbackHandler = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/wss4j/dom/common/KeystoreCallbackHandler.html">KeystoreCallbackHandler</a>();
+<a class="jxr_linenumber" name="L150" href="#L150">150</a> 
+<a class="jxr_linenumber" name="L151" href="#L151">151</a>         <a href="../../../../../org/apache/wss4j/dom/common/SAML1CallbackHandler.html">SAML1CallbackHandler</a>
samlCallbackHandler = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/wss4j/dom/common/SAML1CallbackHandler.html">SAML1CallbackHandler</a>();
+<a class="jxr_linenumber" name="L152" href="#L152">152</a>         samlCallbackHandler.setStatement(SAML1CallbackHandler.Statement.AUTHN);
+<a class="jxr_linenumber" name="L153" href="#L153">153</a>         samlCallbackHandler.setIssuer(<span
class="jxr_string">"www.example.com"</span>);
+<a class="jxr_linenumber" name="L154" href="#L154">154</a>         samlCallbackHandler.setIssuerCrypto(crypto);
+<a class="jxr_linenumber" name="L155" href="#L155">155</a>         samlCallbackHandler.setIssuerName(<span
class="jxr_string">"wss40"</span>);
+<a class="jxr_linenumber" name="L156" href="#L156">156</a>         samlCallbackHandler.setIssuerPassword(<span
class="jxr_string">"security"</span>);
+<a class="jxr_linenumber" name="L157" href="#L157">157</a> 
+<a class="jxr_linenumber" name="L158" href="#L158">158</a>         java.util.Map&lt;String,
Object&gt; config = <strong class="jxr_keyword">new</strong> java.util.TreeMap&lt;String,
Object&gt;();
+<a class="jxr_linenumber" name="L159" href="#L159">159</a>         config.put(WSHandlerConstants.PW_CALLBACK_REF,
callbackHandler);
+<a class="jxr_linenumber" name="L160" href="#L160">160</a>         config.put(WSHandlerConstants.SAML_CALLBACK_REF,
samlCallbackHandler);
 <a class="jxr_linenumber" name="L161" href="#L161">161</a>         reqData.setMsgContext(config);
 <a class="jxr_linenumber" name="L162" href="#L162">162</a> 
 <a class="jxr_linenumber" name="L163" href="#L163">163</a>         <strong
class="jxr_keyword">final</strong> Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
 <a class="jxr_linenumber" name="L164" href="#L164">164</a>         <a href="../../../../../org/apache/wss4j/dom/common/CustomHandler.html">CustomHandler</a>
handler = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/wss4j/dom/common/CustomHandler.html">CustomHandler</a>();
-<a class="jxr_linenumber" name="L165" href="#L165">165</a>         List&lt;HandlerAction&gt;
actions = <strong class="jxr_keyword">new</strong> ArrayList&lt;&gt;();
-<a class="jxr_linenumber" name="L166" href="#L166">166</a>         actions.add(<strong
class="jxr_keyword">new</strong> HandlerAction(WSConstants.ST_UNSIGNED));
-<a class="jxr_linenumber" name="L167" href="#L167">167</a>         actions.add(<strong
class="jxr_keyword">new</strong> HandlerAction(WSConstants.SIGN));
-<a class="jxr_linenumber" name="L168" href="#L168">168</a>         handler.send(
-<a class="jxr_linenumber" name="L169" href="#L169">169</a>             doc,
-<a class="jxr_linenumber" name="L170" href="#L170">170</a>             reqData,
-<a class="jxr_linenumber" name="L171" href="#L171">171</a>             actions,
-<a class="jxr_linenumber" name="L172" href="#L172">172</a>             <strong
class="jxr_keyword">true</strong>
-<a class="jxr_linenumber" name="L173" href="#L173">173</a>         );
-<a class="jxr_linenumber" name="L174" href="#L174">174</a>         <strong
class="jxr_keyword">if</strong> (LOG.isDebugEnabled()) {
-<a class="jxr_linenumber" name="L175" href="#L175">175</a>             String
outputString = XMLUtils.prettyDocumentToString(doc);
-<a class="jxr_linenumber" name="L176" href="#L176">176</a>             LOG.debug(outputString);
-<a class="jxr_linenumber" name="L177" href="#L177">177</a>         }
-<a class="jxr_linenumber" name="L178" href="#L178">178</a> 
-<a class="jxr_linenumber" name="L179" href="#L179">179</a>         verify(doc,
callbackHandler);
-<a class="jxr_linenumber" name="L180" href="#L180">180</a>     }
-<a class="jxr_linenumber" name="L181" href="#L181">181</a> 
-<a class="jxr_linenumber" name="L182" href="#L182">182</a>     <strong class="jxr_keyword">private</strong>
WSHandlerResult verify(
-<a class="jxr_linenumber" name="L183" href="#L183">183</a>         Document doc,
CallbackHandler callbackHandler
-<a class="jxr_linenumber" name="L184" href="#L184">184</a>     ) <strong class="jxr_keyword">throws</strong>
Exception {
-<a class="jxr_linenumber" name="L185" href="#L185">185</a>         RequestData
requestData = <strong class="jxr_keyword">new</strong> RequestData();
-<a class="jxr_linenumber" name="L186" href="#L186">186</a>         requestData.setCallbackHandler(callbackHandler);
-<a class="jxr_linenumber" name="L187" href="#L187">187</a>         requestData.setDecCrypto(crypto);
-<a class="jxr_linenumber" name="L188" href="#L188">188</a>         requestData.setSigVerCrypto(crypto);
-<a class="jxr_linenumber" name="L189" href="#L189">189</a>         requestData.setValidateSamlSubjectConfirmation(false);
-<a class="jxr_linenumber" name="L190" href="#L190">190</a> 
-<a class="jxr_linenumber" name="L191" href="#L191">191</a>         WSHandlerResult
results = secEngine.processSecurityHeader(doc, requestData);
-<a class="jxr_linenumber" name="L192" href="#L192">192</a>         String outputString
=
-<a class="jxr_linenumber" name="L193" href="#L193">193</a>             XMLUtils.prettyDocumentToString(doc);
-<a class="jxr_linenumber" name="L194" href="#L194">194</a>         assertTrue(outputString.indexOf(<span
class="jxr_string">"counter_port_type"</span>) &gt; 0 ? <strong class="jxr_keyword">true</strong>
: false);
-<a class="jxr_linenumber" name="L195" href="#L195">195</a>         <strong
class="jxr_keyword">return</strong> results;
-<a class="jxr_linenumber" name="L196" href="#L196">196</a>     }
-<a class="jxr_linenumber" name="L197" href="#L197">197</a> 
-<a class="jxr_linenumber" name="L198" href="#L198">198</a> }
+<a class="jxr_linenumber" name="L165" href="#L165">165</a>         HandlerAction
action = <strong class="jxr_keyword">new</strong> HandlerAction(WSConstants.ST_SIGNED);
+<a class="jxr_linenumber" name="L166" href="#L166">166</a>         handler.send(
+<a class="jxr_linenumber" name="L167" href="#L167">167</a>             doc,
+<a class="jxr_linenumber" name="L168" href="#L168">168</a>             reqData,
+<a class="jxr_linenumber" name="L169" href="#L169">169</a>             Collections.singletonList(action),
+<a class="jxr_linenumber" name="L170" href="#L170">170</a>             <strong
class="jxr_keyword">true</strong>
+<a class="jxr_linenumber" name="L171" href="#L171">171</a>         );
+<a class="jxr_linenumber" name="L172" href="#L172">172</a>         <strong
class="jxr_keyword">if</strong> (LOG.isDebugEnabled()) {
+<a class="jxr_linenumber" name="L173" href="#L173">173</a>             String
outputString = XMLUtils.prettyDocumentToString(doc);
+<a class="jxr_linenumber" name="L174" href="#L174">174</a>             LOG.debug(outputString);
+<a class="jxr_linenumber" name="L175" href="#L175">175</a>         }
+<a class="jxr_linenumber" name="L176" href="#L176">176</a> 
+<a class="jxr_linenumber" name="L177" href="#L177">177</a>         verify(doc,
callbackHandler);
+<a class="jxr_linenumber" name="L178" href="#L178">178</a>     }
+<a class="jxr_linenumber" name="L179" href="#L179">179</a> 
+<a class="jxr_linenumber" name="L180" href="#L180">180</a>     @Test
+<a class="jxr_linenumber" name="L181" href="#L181">181</a>     <strong class="jxr_keyword">public</strong>
<strong class="jxr_keyword">void</strong> testAssertionWithSignatureAction() <strong
class="jxr_keyword">throws</strong> Exception {
+<a class="jxr_linenumber" name="L182" href="#L182">182</a>         <strong
class="jxr_keyword">final</strong> WSSConfig cfg = WSSConfig.getNewInstance();
+<a class="jxr_linenumber" name="L183" href="#L183">183</a>         <strong
class="jxr_keyword">final</strong> RequestData reqData = <strong class="jxr_keyword">new</strong>
RequestData();
+<a class="jxr_linenumber" name="L184" href="#L184">184</a>         reqData.setWssConfig(cfg);
+<a class="jxr_linenumber" name="L185" href="#L185">185</a>         reqData.setUsername(<span
class="jxr_string">"wss40"</span>);
+<a class="jxr_linenumber" name="L186" href="#L186">186</a> 
+<a class="jxr_linenumber" name="L187" href="#L187">187</a>         CallbackHandler
callbackHandler = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/wss4j/dom/common/KeystoreCallbackHandler.html">KeystoreCallbackHandler</a>();
+<a class="jxr_linenumber" name="L188" href="#L188">188</a> 
+<a class="jxr_linenumber" name="L189" href="#L189">189</a>         <a href="../../../../../org/apache/wss4j/dom/common/SAML1CallbackHandler.html">SAML1CallbackHandler</a>
samlCallbackHandler = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/wss4j/dom/common/SAML1CallbackHandler.html">SAML1CallbackHandler</a>();
+<a class="jxr_linenumber" name="L190" href="#L190">190</a>         samlCallbackHandler.setStatement(SAML1CallbackHandler.Statement.AUTHN);
+<a class="jxr_linenumber" name="L191" href="#L191">191</a>         samlCallbackHandler.setIssuer(<span
class="jxr_string">"www.example.com"</span>);
+<a class="jxr_linenumber" name="L192" href="#L192">192</a> 
+<a class="jxr_linenumber" name="L193" href="#L193">193</a>         java.util.Map&lt;String,
Object&gt; config = <strong class="jxr_keyword">new</strong> java.util.TreeMap&lt;String,
Object&gt;();
+<a class="jxr_linenumber" name="L194" href="#L194">194</a>         config.put(WSHandlerConstants.SIG_PROP_FILE,
<span class="jxr_string">"wss40.properties"</span>);
+<a class="jxr_linenumber" name="L195" href="#L195">195</a>         config.put(WSHandlerConstants.PW_CALLBACK_REF,
callbackHandler);
+<a class="jxr_linenumber" name="L196" href="#L196">196</a>         config.put(WSHandlerConstants.SAML_CALLBACK_REF,
samlCallbackHandler);
+<a class="jxr_linenumber" name="L197" href="#L197">197</a>         config.put(WSHandlerConstants.SIGNATURE_PARTS,
<span class="jxr_string">"{}{"</span> + WSConstants.SAML_NS + <span class="jxr_string">"}Assertion;"</span>);
+<a class="jxr_linenumber" name="L198" href="#L198">198</a>         reqData.setMsgContext(config);
+<a class="jxr_linenumber" name="L199" href="#L199">199</a> 
+<a class="jxr_linenumber" name="L200" href="#L200">200</a>         <strong
class="jxr_keyword">final</strong> Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
+<a class="jxr_linenumber" name="L201" href="#L201">201</a>         <a href="../../../../../org/apache/wss4j/dom/common/CustomHandler.html">CustomHandler</a>
handler = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/wss4j/dom/common/CustomHandler.html">CustomHandler</a>();
+<a class="jxr_linenumber" name="L202" href="#L202">202</a>         List&lt;HandlerAction&gt;
actions = <strong class="jxr_keyword">new</strong> ArrayList&lt;&gt;();
+<a class="jxr_linenumber" name="L203" href="#L203">203</a>         actions.add(<strong
class="jxr_keyword">new</strong> HandlerAction(WSConstants.ST_UNSIGNED));
+<a class="jxr_linenumber" name="L204" href="#L204">204</a>         actions.add(<strong
class="jxr_keyword">new</strong> HandlerAction(WSConstants.SIGN));
+<a class="jxr_linenumber" name="L205" href="#L205">205</a>         handler.send(
+<a class="jxr_linenumber" name="L206" href="#L206">206</a>             doc,
+<a class="jxr_linenumber" name="L207" href="#L207">207</a>             reqData,
+<a class="jxr_linenumber" name="L208" href="#L208">208</a>             actions,
+<a class="jxr_linenumber" name="L209" href="#L209">209</a>             <strong
class="jxr_keyword">true</strong>
+<a class="jxr_linenumber" name="L210" href="#L210">210</a>         );
+<a class="jxr_linenumber" name="L211" href="#L211">211</a>         <strong
class="jxr_keyword">if</strong> (LOG.isDebugEnabled()) {
+<a class="jxr_linenumber" name="L212" href="#L212">212</a>             String
outputString = XMLUtils.prettyDocumentToString(doc);
+<a class="jxr_linenumber" name="L213" href="#L213">213</a>             LOG.debug(outputString);
+<a class="jxr_linenumber" name="L214" href="#L214">214</a>         }
+<a class="jxr_linenumber" name="L215" href="#L215">215</a> 
+<a class="jxr_linenumber" name="L216" href="#L216">216</a>         verify(doc,
callbackHandler);
+<a class="jxr_linenumber" name="L217" href="#L217">217</a>     }
+<a class="jxr_linenumber" name="L218" href="#L218">218</a> 
+<a class="jxr_linenumber" name="L219" href="#L219">219</a>     <strong class="jxr_keyword">private</strong>
WSHandlerResult verify(
+<a class="jxr_linenumber" name="L220" href="#L220">220</a>         Document doc,
CallbackHandler callbackHandler
+<a class="jxr_linenumber" name="L221" href="#L221">221</a>     ) <strong class="jxr_keyword">throws</strong>
Exception {
+<a class="jxr_linenumber" name="L222" href="#L222">222</a>         RequestData
requestData = <strong class="jxr_keyword">new</strong> RequestData();
+<a class="jxr_linenumber" name="L223" href="#L223">223</a>         requestData.setCallbackHandler(callbackHandler);
+<a class="jxr_linenumber" name="L224" href="#L224">224</a>         requestData.setDecCrypto(crypto);
+<a class="jxr_linenumber" name="L225" href="#L225">225</a>         requestData.setSigVerCrypto(crypto);
+<a class="jxr_linenumber" name="L226" href="#L226">226</a>         requestData.setValidateSamlSubjectConfirmation(false);
+<a class="jxr_linenumber" name="L227" href="#L227">227</a> 
+<a class="jxr_linenumber" name="L228" href="#L228">228</a>         WSHandlerResult
results = secEngine.processSecurityHeader(doc, requestData);
+<a class="jxr_linenumber" name="L229" href="#L229">229</a>         String outputString
=
+<a class="jxr_linenumber" name="L230" href="#L230">230</a>             XMLUtils.prettyDocumentToString(doc);
+<a class="jxr_linenumber" name="L231" href="#L231">231</a>         assertTrue(outputString.indexOf(<span
class="jxr_string">"counter_port_type"</span>) &gt; 0 ? <strong class="jxr_keyword">true</strong>
: false);
+<a class="jxr_linenumber" name="L232" href="#L232">232</a>         <strong
class="jxr_keyword">return</strong> results;
+<a class="jxr_linenumber" name="L233" href="#L233">233</a>     }
+<a class="jxr_linenumber" name="L234" href="#L234">234</a> 
+<a class="jxr_linenumber" name="L235" href="#L235">235</a> }
 </pre>
 <hr/>
 <div id="footer">Copyright &#169; 2004&#x2013;2017 <a href="http://www.apache.org/">The
Apache Software Foundation</a>. All rights reserved.</div>



Mime
View raw message