blob: 9684fc57f28402e148cef1c11db3cceb8b78397f [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Coverage Report</title>
<link title="Style" type="text/css" rel="stylesheet" href="css/main.css"/>
<script type="text/javascript" src="js/popup.js"></script>
</head>
<body>
<h5>Coverage Report - com.google.enterprise.adaptor.secmgr.modules.SamlClient</h5>
<div class="separator">&nbsp;</div>
<table class="report">
<thead><tr> <td class="heading">Classes in this File</td> <td class="heading"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">Line Coverage</a></td> <td class="heading"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">Branch Coverage</a></td> <td class="heading"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">Complexity</a></td></tr></thead>
<tr><td><a href="com.google.enterprise.adaptor.secmgr.modules.SamlClient.html">SamlClient</a></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40">118</td><td class="percentgraph"><div class="percentgraph"><div class="greenbar" style="width:37px"><span class="text">70/188</span></div></div></td></tr></table></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40">41</td><td class="percentgraph"><div class="percentgraph"><div class="greenbar" style="width:21px"><span class="text">11/52</span></div></div></td></tr></table></td><td class="value"><span class="hidden">3.3636363636363638;</span>3.364</td></tr>
<tr><td><a href="com.google.enterprise.adaptor.secmgr.modules.SamlClient.html">SamlClient$DecodedAuthzResponse</a></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40">4</td><td class="percentgraph"><div class="percentgraph"><div class="greenbar" style="width:0px"><span class="text">0/4</span></div></div></td></tr></table></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">N/A</a></td><td class="percentgraph"><div class="percentgraph"><div class="na" style="width:100px"><span class="text"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">N/A</a></span></div></div></td></tr></table></td><td class="value"><span class="hidden">3.3636363636363638;</span>3.364</td></tr>
<tr><td><a href="com.google.enterprise.adaptor.secmgr.modules.SamlClient.html">SamlClient$RedirectEncoder</a></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40">11</td><td class="percentgraph"><div class="percentgraph"><div class="greenbar" style="width:35px"><span class="text">6/17</span></div></div></td></tr></table></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40">7</td><td class="percentgraph"><div class="percentgraph"><div class="greenbar" style="width:12px"><span class="text">1/8</span></div></div></td></tr></table></td><td class="value"><span class="hidden">3.3636363636363638;</span>3.364</td></tr>
</table>
<div class="separator">&nbsp;</div>
<table cellspacing="0" cellpadding="0" class="src">
<tr> <td class="numLine">&nbsp;1</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment">// Copyright 2009 Google Inc.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;2</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment">//</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;3</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment">// Licensed under the Apache License, Version 2.0 (the "License");</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;4</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment">// you may not use this file except in compliance with the License.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;5</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment">// You may obtain a copy of the License at</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;6</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment">//</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;7</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment">// http://www.apache.org/licenses/LICENSE-2.0</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;8</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment">//</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;9</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment">// Unless required by applicable law or agreed to in writing, software</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;10</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment">// distributed under the License is distributed on an "AS IS" BASIS,</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;11</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment">// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;12</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment">// See the License for the specific language governing permissions and</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;13</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment">// limitations under the License.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;14</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;15</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">package</span> com.google.enterprise.adaptor.secmgr.modules;</pre></td></tr>
<tr> <td class="numLine">&nbsp;16</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;17</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> <span class="keyword">static</span> com.google.enterprise.adaptor.secmgr.saml.OpenSamlUtil.initializeLocalEntity;</pre></td></tr>
<tr> <td class="numLine">&nbsp;18</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> <span class="keyword">static</span> com.google.enterprise.adaptor.secmgr.saml.OpenSamlUtil.initializePeerEntity;</pre></td></tr>
<tr> <td class="numLine">&nbsp;19</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> <span class="keyword">static</span> com.google.enterprise.adaptor.secmgr.saml.OpenSamlUtil.makeAction;</pre></td></tr>
<tr> <td class="numLine">&nbsp;20</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> <span class="keyword">static</span> com.google.enterprise.adaptor.secmgr.saml.OpenSamlUtil.makeArtifactResolve;</pre></td></tr>
<tr> <td class="numLine">&nbsp;21</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> <span class="keyword">static</span> com.google.enterprise.adaptor.secmgr.saml.OpenSamlUtil.makeAuthnRequest;</pre></td></tr>
<tr> <td class="numLine">&nbsp;22</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> <span class="keyword">static</span> com.google.enterprise.adaptor.secmgr.saml.OpenSamlUtil.makeAuthzDecisionQuery;</pre></td></tr>
<tr> <td class="numLine">&nbsp;23</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> <span class="keyword">static</span> com.google.enterprise.adaptor.secmgr.saml.OpenSamlUtil.makeSamlMessageContext;</pre></td></tr>
<tr> <td class="numLine">&nbsp;24</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> <span class="keyword">static</span> com.google.enterprise.adaptor.secmgr.saml.OpenSamlUtil.makeSubject;</pre></td></tr>
<tr> <td class="numLine">&nbsp;25</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> <span class="keyword">static</span> com.google.enterprise.adaptor.secmgr.saml.OpenSamlUtil.runDecoder;</pre></td></tr>
<tr> <td class="numLine">&nbsp;26</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> <span class="keyword">static</span> com.google.enterprise.adaptor.secmgr.saml.OpenSamlUtil.runEncoder;</pre></td></tr>
<tr> <td class="numLine">&nbsp;27</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> <span class="keyword">static</span> org.opensaml.common.xml.SAMLConstants.SAML20P_NS;</pre></td></tr>
<tr> <td class="numLine">&nbsp;28</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> <span class="keyword">static</span> org.opensaml.common.xml.SAMLConstants.SAML2_REDIRECT_BINDING_URI;</pre></td></tr>
<tr> <td class="numLine">&nbsp;29</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> <span class="keyword">static</span> org.opensaml.common.xml.SAMLConstants.SAML2_SOAP11_BINDING_URI;</pre></td></tr>
<tr> <td class="numLine">&nbsp;30</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;31</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> com.google.common.base.Preconditions;</pre></td></tr>
<tr> <td class="numLine">&nbsp;32</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> com.google.common.collect.Maps;</pre></td></tr>
<tr> <td class="numLine">&nbsp;33</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> com.google.enterprise.adaptor.secmgr.common.AuthzStatus;</pre></td></tr>
<tr> <td class="numLine">&nbsp;34</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> com.google.enterprise.adaptor.secmgr.http.HttpClientInterface;</pre></td></tr>
<tr> <td class="numLine">&nbsp;35</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> com.google.enterprise.adaptor.secmgr.http.HttpExchange;</pre></td></tr>
<tr> <td class="numLine">&nbsp;36</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> com.google.enterprise.adaptor.secmgr.saml.HTTPSOAP11MultiContextDecoder;</pre></td></tr>
<tr> <td class="numLine">&nbsp;37</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> com.google.enterprise.adaptor.secmgr.saml.HTTPSOAP11MultiContextEncoder;</pre></td></tr>
<tr> <td class="numLine">&nbsp;38</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> com.google.enterprise.adaptor.secmgr.saml.HttpExchangeToInTransport;</pre></td></tr>
<tr> <td class="numLine">&nbsp;39</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> com.google.enterprise.adaptor.secmgr.saml.HttpExchangeToOutTransport;</pre></td></tr>
<tr> <td class="numLine">&nbsp;40</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> com.google.enterprise.adaptor.secmgr.saml.SamlLogUtil;</pre></td></tr>
<tr> <td class="numLine">&nbsp;41</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;42</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.joda.time.DateTime;</pre></td></tr>
<tr> <td class="numLine">&nbsp;43</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.opensaml.common.SAMLObject;</pre></td></tr>
<tr> <td class="numLine">&nbsp;44</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.opensaml.common.binding.SAMLMessageContext;</pre></td></tr>
<tr> <td class="numLine">&nbsp;45</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.opensaml.common.xml.SAMLConstants;</pre></td></tr>
<tr> <td class="numLine">&nbsp;46</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.opensaml.saml2.binding.decoding.HTTPSOAP11Decoder;</pre></td></tr>
<tr> <td class="numLine">&nbsp;47</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.opensaml.saml2.binding.encoding.HTTPRedirectDeflateEncoder;</pre></td></tr>
<tr> <td class="numLine">&nbsp;48</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.opensaml.saml2.binding.encoding.HTTPSOAP11Encoder;</pre></td></tr>
<tr> <td class="numLine">&nbsp;49</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.opensaml.saml2.core.Action;</pre></td></tr>
<tr> <td class="numLine">&nbsp;50</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.opensaml.saml2.core.ArtifactResolve;</pre></td></tr>
<tr> <td class="numLine">&nbsp;51</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.opensaml.saml2.core.ArtifactResponse;</pre></td></tr>
<tr> <td class="numLine">&nbsp;52</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.opensaml.saml2.core.Assertion;</pre></td></tr>
<tr> <td class="numLine">&nbsp;53</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.opensaml.saml2.core.AuthnRequest;</pre></td></tr>
<tr> <td class="numLine">&nbsp;54</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.opensaml.saml2.core.AuthzDecisionQuery;</pre></td></tr>
<tr> <td class="numLine">&nbsp;55</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.opensaml.saml2.core.AuthzDecisionStatement;</pre></td></tr>
<tr> <td class="numLine">&nbsp;56</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.opensaml.saml2.core.DecisionTypeEnumeration;</pre></td></tr>
<tr> <td class="numLine">&nbsp;57</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.opensaml.saml2.core.NameID;</pre></td></tr>
<tr> <td class="numLine">&nbsp;58</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.opensaml.saml2.core.Response;</pre></td></tr>
<tr> <td class="numLine">&nbsp;59</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.opensaml.saml2.core.Statement;</pre></td></tr>
<tr> <td class="numLine">&nbsp;60</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.opensaml.saml2.core.StatusCode;</pre></td></tr>
<tr> <td class="numLine">&nbsp;61</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.opensaml.saml2.metadata.ArtifactResolutionService;</pre></td></tr>
<tr> <td class="numLine">&nbsp;62</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.opensaml.saml2.metadata.AssertionConsumerService;</pre></td></tr>
<tr> <td class="numLine">&nbsp;63</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.opensaml.saml2.metadata.AuthzService;</pre></td></tr>
<tr> <td class="numLine">&nbsp;64</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.opensaml.saml2.metadata.EntityDescriptor;</pre></td></tr>
<tr> <td class="numLine">&nbsp;65</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.opensaml.saml2.metadata.SPSSODescriptor;</pre></td></tr>
<tr> <td class="numLine">&nbsp;66</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.opensaml.saml2.metadata.SingleSignOnService;</pre></td></tr>
<tr> <td class="numLine">&nbsp;67</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.opensaml.util.URLBuilder;</pre></td></tr>
<tr> <td class="numLine">&nbsp;68</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.opensaml.ws.message.encoder.MessageEncoder;</pre></td></tr>
<tr> <td class="numLine">&nbsp;69</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.opensaml.ws.message.encoder.MessageEncodingException;</pre></td></tr>
<tr> <td class="numLine">&nbsp;70</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.opensaml.ws.transport.http.HTTPInTransport;</pre></td></tr>
<tr> <td class="numLine">&nbsp;71</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.opensaml.ws.transport.http.HTTPOutTransport;</pre></td></tr>
<tr> <td class="numLine">&nbsp;72</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.opensaml.xml.security.credential.Credential;</pre></td></tr>
<tr> <td class="numLine">&nbsp;73</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.opensaml.xml.util.Pair;</pre></td></tr>
<tr> <td class="numLine">&nbsp;74</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;75</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.io.IOException;</pre></td></tr>
<tr> <td class="numLine">&nbsp;76</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.net.HttpURLConnection;</pre></td></tr>
<tr> <td class="numLine">&nbsp;77</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.net.URI;</pre></td></tr>
<tr> <td class="numLine">&nbsp;78</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.net.URL;</pre></td></tr>
<tr> <td class="numLine">&nbsp;79</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.Collection;</pre></td></tr>
<tr> <td class="numLine">&nbsp;80</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.List;</pre></td></tr>
<tr> <td class="numLine">&nbsp;81</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.Map;</pre></td></tr>
<tr> <td class="numLine">&nbsp;82</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.logging.Logger;</pre></td></tr>
<tr> <td class="numLine">&nbsp;83</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;84</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> javax.annotation.concurrent.GuardedBy;</pre></td></tr>
<tr> <td class="numLine">&nbsp;85</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> javax.annotation.concurrent.ThreadSafe;</pre></td></tr>
<tr> <td class="numLine">&nbsp;86</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;87</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment">/**</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;88</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * A library implementing most of the functionality of a SAML service provider.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;89</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * This library knows how to send an authentication request via the redirect</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;90</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * binding, and to receive a response via either artifact or POST binding.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;91</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;92</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;@ThreadSafe</pre></td></tr>
<tr> <td class="numLine">&nbsp;93</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">public</span> <span class="keyword">class</span> SamlClient {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;94</td> <td class="nbHitsCovered">&nbsp;1</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> <span class="keyword">static</span> <span class="keyword">final</span> Logger LOGGER = Logger.getLogger(SamlClient.<span class="keyword">class</span>.getName());</pre></td></tr>
<tr> <td class="numLine">&nbsp;95</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;96</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> <span class="keyword">final</span> EntityDescriptor localEntity;</pre></td></tr>
<tr> <td class="numLine">&nbsp;97</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> <span class="keyword">final</span> EntityDescriptor peerEntity;</pre></td></tr>
<tr> <td class="numLine">&nbsp;98</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> <span class="keyword">final</span> String providerName;</pre></td></tr>
<tr> <td class="numLine">&nbsp;99</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> <span class="keyword">final</span> Credential signingCredential;</pre></td></tr>
<tr> <td class="numLine">&nbsp;100</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> <span class="keyword">final</span> HttpClientInterface httpClient;</pre></td></tr>
<tr> <td class="numLine">&nbsp;101</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> <span class="keyword">final</span> <span class="keyword">int</span> timeout;</pre></td></tr>
<tr> <td class="numLine">&nbsp;102</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;103</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; @GuardedBy(<span class="string">"requestIdLock"</span>)</pre></td></tr>
<tr> <td class="numLine">&nbsp;104</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> String requestId;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;105</td> <td class="nbHitsCovered">&nbsp;1</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> <span class="keyword">static</span> <span class="keyword">final</span> Object requestIdLock = <span class="keyword">new</span> Object();</pre></td></tr>
<tr> <td class="numLine">&nbsp;106</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;107</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">/**</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;108</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * Create an instance of the client library.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;109</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> *</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;110</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * @param localEntity Metadata for the the local entity (the service provider</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;111</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * using this library).</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;112</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * @param peerEntity Metadata for the peer entity (the SAML IdP).</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;113</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * @param providerName Descriptive name of the service provider.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;114</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * @param signingCredential A credential to use for signing the outgoing</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;115</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * request. May be null if signing isn't needed.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;116</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * @param httpClient An HTTP client to use for resolving any artifact returned</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;117</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * from the IdP. May be null if the artifact binding isn't being used.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;118</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;119</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">public</span> SamlClient(EntityDescriptor localEntity, EntityDescriptor peerEntity,</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;120</td> <td class="nbHitsCovered">&nbsp;10</td> <td class="src"><pre class="src">&nbsp; String providerName, Credential signingCredential, HttpClientInterface httpClient) {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;121</td> <td class="nbHitsCovered">&nbsp;10</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">this</span>.localEntity = localEntity;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;122</td> <td class="nbHitsCovered">&nbsp;10</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">this</span>.peerEntity = peerEntity;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;123</td> <td class="nbHitsCovered">&nbsp;10</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">this</span>.providerName = providerName;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;124</td> <td class="nbHitsCovered">&nbsp;10</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">this</span>.signingCredential = signingCredential;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;125</td> <td class="nbHitsCovered">&nbsp;10</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">this</span>.httpClient = httpClient;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;126</td> <td class="nbHitsCovered">&nbsp;10</td> <td class="src"><pre class="src">&nbsp; timeout = -1;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;127</td> <td class="nbHitsCovered">&nbsp;10</td> <td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;128</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;129</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">/**</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;130</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * Create an instance of the client library.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;131</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> *</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;132</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * @param localEntity Metadata for the the local entity (the service provider</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;133</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * using this library).</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;134</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * @param peerEntity Metadata for the peer entity (the SAML IdP).</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;135</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * @param providerName Descriptive name of the service provider.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;136</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * @param signingCredential A credential to use for signing the outgoing</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;137</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * request. May be null if signing isn't needed.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;138</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * @param httpClient An HTTP client to use for resolving any artifact returned</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;139</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * from the IdP. May be null if the artifact binding isn't being</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;140</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * @param timeout The http socket timeout value in milliseconds.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;141</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * -1 means to use the httpClient default timeout.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;142</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;143</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">public</span> SamlClient(EntityDescriptor localEntity, EntityDescriptor peerEntity,</pre></td></tr>
<tr> <td class="numLine">&nbsp;144</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; String providerName, Credential signingCredential, HttpClientInterface httpClient,</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;145</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">int</span> timeout) {</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;146</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">this</span>.localEntity = localEntity;</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;147</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">this</span>.peerEntity = peerEntity;</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;148</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">this</span>.providerName = providerName;</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;149</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">this</span>.signingCredential = signingCredential;</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;150</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">this</span>.httpClient = httpClient;</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;151</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">this</span>.timeout = timeout;</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;152</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; }</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;153</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;154</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">/**</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;155</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * Get the metadata for this client's local entity.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;156</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> *</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;157</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * @return The entity descriptor for the local entity.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;158</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;159</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">public</span> EntityDescriptor getLocalEntity() {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;160</td> <td class="nbHitsCovered">&nbsp;7</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">return</span> localEntity;</pre></td></tr>
<tr> <td class="numLine">&nbsp;161</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;162</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;163</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">/**</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;164</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * Get the metadata for this client's peer entity.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;165</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> *</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;166</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * @return The entity descriptor for the peer entity.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;167</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;168</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">public</span> EntityDescriptor getPeerEntity() {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;169</td> <td class="nbHitsCovered">&nbsp;18</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">return</span> peerEntity;</pre></td></tr>
<tr> <td class="numLine">&nbsp;170</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;171</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;172</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">/**</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;173</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * Get the message ID of the most recent request.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;174</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> *</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;175</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * @return The message ID of the most recent request, never null.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;176</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;177</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">public</span> String getRequestId() {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;178</td> <td class="nbHitsCovered">&nbsp;26</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">synchronized</span> (requestIdLock) {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;179</td> <td class="nbHitsCovered">&nbsp;26</td> <td class="src"><pre class="src">&nbsp; Preconditions.checkNotNull(requestId);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;180</td> <td class="nbHitsCovered">&nbsp;26</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">return</span> requestId;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;181</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; }</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;182</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;183</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;184</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">/**</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;185</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * Get the metadata for this client's local POST assertion consumer service.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;186</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> *</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;187</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * @return The assertion consumer service descriptor.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;188</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;189</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">public</span> AssertionConsumerService getPostAssertionConsumerService() {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;190</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">return</span> getAssertionConsumerService(SAMLConstants.SAML2_POST_BINDING_URI);</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;191</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;192</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;193</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">/**</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;194</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * Get the metadata for this client's local ARTIFACT assertion consumer service.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;195</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> *</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;196</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * @return The assertion consumer service descriptor.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;197</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;198</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">public</span> AssertionConsumerService getArtifactAssertionConsumerService() {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;199</td> <td class="nbHitsCovered">&nbsp;6</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">return</span> getAssertionConsumerService(SAMLConstants.SAML2_ARTIFACT_BINDING_URI);</pre></td></tr>
<tr> <td class="numLine">&nbsp;200</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;201</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;202</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> AssertionConsumerService getAssertionConsumerService(String binding) {</pre></td></tr>
<tr> <td class="numLine">&nbsp;203</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">for</span> (AssertionConsumerService acs :</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;204</td> <td class="nbHitsUncovered"><a title="Line 204: Conditional coverage 50% (1/2).">&nbsp;6</a></td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<a title="Line 204: Conditional coverage 50% (1/2)."> localEntity.getSPSSODescriptor(SAML20P_NS).getAssertionConsumerServices()) {</a></span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;205</td> <td class="nbHitsUncovered"><a title="Line 205: Conditional coverage 50% (1/2).">&nbsp;6</a></td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<a title="Line 205: Conditional coverage 50% (1/2)."> <span class="keyword">if</span> (binding.equals(acs.getBinding())) {</a></span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;206</td> <td class="nbHitsCovered">&nbsp;6</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">return</span> acs;</pre></td></tr>
<tr> <td class="numLine">&nbsp;207</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;208</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;209</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">throw</span> <span class="keyword">new</span> IllegalArgumentException(<span class="string">"No assertion consumer with binding "</span> + binding);</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;210</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;211</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;212</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">/**</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;213</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * Send an AuthnRequest message to the IdP via the redirect protocol.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;214</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> *</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;215</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * @param response The HTTP response message that will be filled with the encoded redirect.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;216</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * @throws IOException if errors occur during the encoding.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;217</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;218</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">public</span> <span class="keyword">void</span> sendAuthnRequest(HTTPOutTransport outTransport)</pre></td></tr>
<tr> <td class="numLine">&nbsp;219</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">throws</span> IOException {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;220</td> <td class="nbHitsCovered">&nbsp;10</td> <td class="src"><pre class="src">&nbsp; SAMLMessageContext&lt;SAMLObject, AuthnRequest, NameID&gt; context = makeSamlMessageContext();</pre></td></tr>
<tr> <td class="numLine">&nbsp;221</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;222</td> <td class="nbHitsCovered">&nbsp;10</td> <td class="src"><pre class="src">&nbsp; SPSSODescriptor sp = localEntity.getSPSSODescriptor(SAML20P_NS);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;223</td> <td class="nbHitsCovered">&nbsp;10</td> <td class="src"><pre class="src">&nbsp; initializeLocalEntity(context, localEntity, sp);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;224</td> <td class="nbHitsCovered">&nbsp;10</td> <td class="src"><pre class="src">&nbsp; initializePeerEntity(context, peerEntity, peerEntity.getIDPSSODescriptor(SAML20P_NS),</pre></td></tr>
<tr> <td class="numLine">&nbsp;225</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; SingleSignOnService.DEFAULT_ELEMENT_NAME,</pre></td></tr>
<tr> <td class="numLine">&nbsp;226</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; SAML2_REDIRECT_BINDING_URI);</pre></td></tr>
<tr> <td class="numLine">&nbsp;227</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;228</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// Generate the request</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;229</td> <td class="nbHitsCovered">&nbsp;10</td> <td class="src"><pre class="src">&nbsp; AuthnRequest authnRequest =</pre></td></tr>
<tr> <td class="numLine">&nbsp;230</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; makeAuthnRequest(context.getOutboundMessageIssuer(), <span class="keyword">new</span> DateTime());</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;231</td> <td class="nbHitsCovered">&nbsp;10</td> <td class="src"><pre class="src">&nbsp; authnRequest.setProviderName(providerName);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;232</td> <td class="nbHitsCovered">&nbsp;10</td> <td class="src"><pre class="src">&nbsp; authnRequest.setIsPassive(<span class="keyword">false</span>);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;233</td> <td class="nbHitsUncovered"><a title="Line 233: Conditional coverage 50% (1/2).">&nbsp;10</a></td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<a title="Line 233: Conditional coverage 50% (1/2)."> <span class="keyword">if</span> (signingCredential != <span class="keyword">null</span>) {</a></span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;234</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; authnRequest.setAssertionConsumerServiceURL(</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;235</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; sp.getDefaultAssertionConsumerService().getLocation());</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;236</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; authnRequest.setProtocolBinding(</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;237</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; sp.getDefaultAssertionConsumerService().getBinding());</pre></td></tr>
<tr> <td class="numLine">&nbsp;238</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// Must sign the message in order for ACS URL to be trusted by peer.</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;239</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; context.setOutboundSAMLMessageSigningCredential(signingCredential);</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;240</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;241</td> <td class="nbHitsCovered">&nbsp;10</td> <td class="src"><pre class="src">&nbsp; authnRequest.setDestination(context.getPeerEntityEndpoint().getLocation());</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;242</td> <td class="nbHitsCovered">&nbsp;10</td> <td class="src"><pre class="src">&nbsp; context.setOutboundSAMLMessage(authnRequest);</pre></td></tr>
<tr> <td class="numLine">&nbsp;243</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;244</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// Remember the request ID for later.</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;245</td> <td class="nbHitsCovered">&nbsp;10</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">synchronized</span> (requestIdLock) {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;246</td> <td class="nbHitsCovered">&nbsp;10</td> <td class="src"><pre class="src">&nbsp; requestId = authnRequest.getID();</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;247</td> <td class="nbHitsCovered">&nbsp;10</td> <td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;248</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;249</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// Not needed:</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;250</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">//context.setRelayState();</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;251</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;252</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// Send the request via redirect to the user agent</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;253</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">//ServletBase.initResponse(response);</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;254</td> <td class="nbHitsCovered">&nbsp;10</td> <td class="src"><pre class="src">&nbsp; context.setOutboundMessageTransport(outTransport);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;255</td> <td class="nbHitsCovered">&nbsp;10</td> <td class="src"><pre class="src">&nbsp; runEncoder(<span class="keyword">new</span> RedirectEncoder(), context);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;256</td> <td class="nbHitsCovered">&nbsp;10</td> <td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;257</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;258</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">/**</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;259</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * Decode a SAML response sent via the artifact binding.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;260</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> *</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;261</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * @param request The HTTP request containing the artifact.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;262</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * @return The decoded response, or null if there was an error decoding the message. In</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;263</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * this case, a log file entry is generated, so the caller doesn't need to know the</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;264</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * details of the failure.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;265</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * @throws IOException for various errors related to session and metadata, or for the</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;266</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * artifact resolution interchange.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;267</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;268</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">public</span> Response decodeArtifactResponse(URI requestUri, HTTPInTransport inTransport)</pre></td></tr>
<tr> <td class="numLine">&nbsp;269</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">throws</span> IOException {</pre></td></tr>
<tr> <td class="numLine">&nbsp;270</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// The OpenSAML HTTPArtifactDecoder isn't implemented, so we must manually decode the</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;271</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// artifact.</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;272</td> <td class="nbHitsCovered">&nbsp;6</td> <td class="src"><pre class="src">&nbsp; String query = requestUri.getQuery();</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;273</td> <td class="nbHitsCovered">&nbsp;6</td> <td class="src"><pre class="src">&nbsp; String artifact = <span class="keyword">null</span>;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;274</td> <td class="nbHitsUncovered"><a title="Line 274: Conditional coverage 50% (1/2).">&nbsp;6</a></td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<a title="Line 274: Conditional coverage 50% (1/2)."> <span class="keyword">for</span> (String kvPair : query.split(<span class="string">"&amp;"</span>)) {</a></span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;275</td> <td class="nbHitsCovered">&nbsp;6</td> <td class="src"><pre class="src">&nbsp; String[] kv = kvPair.split(<span class="string">"="</span>, 2);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;276</td> <td class="nbHitsUncovered"><a title="Line 276: Conditional coverage 50% (1/2).">&nbsp;6</a></td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<a title="Line 276: Conditional coverage 50% (1/2)."> <span class="keyword">if</span> (kv.length != 2) {</a></span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;277</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">continue</span>;</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;278</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;279</td> <td class="nbHitsUncovered"><a title="Line 279: Conditional coverage 50% (1/2).">&nbsp;6</a></td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<a title="Line 279: Conditional coverage 50% (1/2)."> <span class="keyword">if</span> (!<span class="string">"SAMLart"</span>.equals(kv[0])) {</a></span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;280</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">continue</span>;</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;281</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;282</td> <td class="nbHitsCovered">&nbsp;6</td> <td class="src"><pre class="src">&nbsp; artifact = kv[1];</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;283</td> <td class="nbHitsCovered">&nbsp;6</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">break</span>;</pre></td></tr>
<tr> <td class="numLine">&nbsp;284</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;285</td> <td class="nbHitsUncovered"><a title="Line 285: Conditional coverage 50% (1/2).">&nbsp;6</a></td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<a title="Line 285: Conditional coverage 50% (1/2)."> <span class="keyword">if</span> (artifact == <span class="keyword">null</span>) {</a></span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;286</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; LOGGER.warning(<span class="string">"No artifact in message"</span>);</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;287</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">return</span> <span class="keyword">null</span>;</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;288</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;289</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;290</td> <td class="nbHitsCovered">&nbsp;6</td> <td class="src"><pre class="src">&nbsp; SAMLObject message = resolveArtifact(inTransport, artifact);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;291</td> <td class="nbHitsCovered"><a title="Line 291: Conditional coverage 100% (2/2).">&nbsp;6</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 291: Conditional coverage 100% (2/2)."> <span class="keyword">if</span> (!(message <span class="keyword">instanceof</span> Response)) {</a></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;292</td> <td class="nbHitsCovered">&nbsp;1</td> <td class="src"><pre class="src">&nbsp; LOGGER.warning(<span class="string">"Unable to resolve artifact"</span>);</pre></td></tr>
<tr> <td class="numLine">&nbsp;293</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;294</td> <td class="nbHitsCovered">&nbsp;6</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">return</span> (Response) message;</pre></td></tr>
<tr> <td class="numLine">&nbsp;295</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;296</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;297</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">/**</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;298</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * Resolve a SAML artifact.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;299</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> *</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;300</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * @param session The authentication session.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;301</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * @param request The HTTP request containing the artifact, to identify the artifact</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;302</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * resolution service to use.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;303</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * @param artifact The artifact to resolve.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;304</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * @return The SAML object that the artifact resolves to.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;305</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * @throws IOException</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;306</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;307</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> SAMLObject resolveArtifact(HTTPInTransport inTransport,</pre></td></tr>
<tr> <td class="numLine">&nbsp;308</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; String artifact)</pre></td></tr>
<tr> <td class="numLine">&nbsp;309</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">throws</span> IOException {</pre></td></tr>
<tr> <td class="numLine">&nbsp;310</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// Establish the SAML message context.</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;311</td> <td class="nbHitsCovered">&nbsp;6</td> <td class="src"><pre class="src">&nbsp; SAMLMessageContext&lt;ArtifactResponse, ArtifactResolve, NameID&gt; context =</pre></td></tr>
<tr> <td class="numLine">&nbsp;312</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; makeSamlMessageContext();</pre></td></tr>
<tr> <td class="numLine">&nbsp;313</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;314</td> <td class="nbHitsCovered">&nbsp;6</td> <td class="src"><pre class="src">&nbsp; initializeLocalEntity(context, localEntity, localEntity.getSPSSODescriptor(SAML20P_NS));</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;315</td> <td class="nbHitsCovered">&nbsp;6</td> <td class="src"><pre class="src">&nbsp; initializePeerEntity(context, peerEntity, peerEntity.getIDPSSODescriptor(SAML20P_NS),</pre></td></tr>
<tr> <td class="numLine">&nbsp;316</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; ArtifactResolutionService.DEFAULT_ELEMENT_NAME,</pre></td></tr>
<tr> <td class="numLine">&nbsp;317</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; SAML2_SOAP11_BINDING_URI);</pre></td></tr>
<tr> <td class="numLine">&nbsp;318</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;319</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// Generate the request.</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;320</td> <td class="nbHitsCovered">&nbsp;6</td> <td class="src"><pre class="src">&nbsp; context.setOutboundSAMLMessage(</pre></td></tr>
<tr> <td class="numLine">&nbsp;321</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; makeArtifactResolve(localEntity.getEntityID(), <span class="keyword">new</span> DateTime(), artifact));</pre></td></tr>
<tr> <td class="numLine">&nbsp;322</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;323</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// Encode the request.</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;324</td> <td class="nbHitsCovered">&nbsp;6</td> <td class="src"><pre class="src">&nbsp; HttpExchange exchange =</pre></td></tr>
<tr> <td class="numLine">&nbsp;325</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; httpClient.postExchange(<span class="keyword">new</span> URL(context.getPeerEntityEndpoint().getLocation()), <span class="keyword">null</span>);</pre></td></tr>
<tr> <td class="numLine">&nbsp;326</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">try</span> {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;327</td> <td class="nbHitsCovered">&nbsp;6</td> <td class="src"><pre class="src">&nbsp; HttpExchangeToOutTransport out = <span class="keyword">new</span> HttpExchangeToOutTransport(exchange);</pre></td></tr>
<tr> <td class="numLine">&nbsp;328</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">try</span> {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;329</td> <td class="nbHitsCovered">&nbsp;6</td> <td class="src"><pre class="src">&nbsp; context.setOutboundMessageTransport(out);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;330</td> <td class="nbHitsCovered">&nbsp;6</td> <td class="src"><pre class="src">&nbsp; context.setRelayState(inTransport.getHeaderValue(<span class="string">"RelayState"</span>));</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;331</td> <td class="nbHitsCovered">&nbsp;6</td> <td class="src"><pre class="src">&nbsp; runEncoder(<span class="keyword">new</span> HTTPSOAP11Encoder(), context);</pre></td></tr>
<tr> <td class="numLine">&nbsp;332</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; } <span class="keyword">finally</span> {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;333</td> <td class="nbHitsCovered">&nbsp;6</td> <td class="src"><pre class="src">&nbsp; out.finish();</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;334</td> <td class="nbHitsCovered">&nbsp;6</td> <td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;335</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; } <span class="keyword">finally</span> {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;336</td> <td class="nbHitsCovered">&nbsp;6</td> <td class="src"><pre class="src">&nbsp; exchange.close();</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;337</td> <td class="nbHitsCovered">&nbsp;6</td> <td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;338</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;339</td> <td class="nbHitsUncovered"><a title="Line 339: Conditional coverage 50% (1/2).">&nbsp;6</a></td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<a title="Line 339: Conditional coverage 50% (1/2)."> <span class="keyword">if</span> (timeout != -1) {</a></span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;340</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; exchange.setTimeout(timeout);</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;341</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;342</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;343</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// Do HTTP exchange.</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;344</td> <td class="nbHitsCovered">&nbsp;6</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">int</span> status = exchange.exchange();</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;345</td> <td class="nbHitsUncovered"><a title="Line 345: Conditional coverage 50% (1/2).">&nbsp;6</a></td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<a title="Line 345: Conditional coverage 50% (1/2)."> <span class="keyword">if</span> (status != HttpURLConnection.HTTP_OK) {</a></span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;346</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; LOGGER.warning(<span class="string">"Incorrect HTTP status: "</span> + status);</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;347</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">return</span> <span class="keyword">null</span>;</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;348</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;349</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;350</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// Decode the response.</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;351</td> <td class="nbHitsCovered">&nbsp;6</td> <td class="src"><pre class="src">&nbsp; context.setInboundMessageTransport(<span class="keyword">new</span> HttpExchangeToInTransport(exchange));</pre></td></tr>
<tr> <td class="numLine">&nbsp;352</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">try</span> {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;353</td> <td class="nbHitsCovered">&nbsp;6</td> <td class="src"><pre class="src">&nbsp; runDecoder(<span class="keyword">new</span> HTTPSOAP11Decoder(), context);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;354</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; } <span class="keyword">catch</span> (IOException e) {</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;355</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; LOGGER.warning(<span class="string">"IOException: "</span> + e.getMessage());</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;356</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">return</span> <span class="keyword">null</span>;</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;357</td> <td class="nbHitsCovered">&nbsp;6</td> <td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;358</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;359</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// Return the decoded response.</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;360</td> <td class="nbHitsCovered">&nbsp;6</td> <td class="src"><pre class="src">&nbsp; ArtifactResponse artifactResponse = context.getInboundSAMLMessage();</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;361</td> <td class="nbHitsCovered">&nbsp;6</td> <td class="src"><pre class="src">&nbsp; Preconditions.checkNotNull(artifactResponse, <span class="string">"Decoded SAML response is null"</span>);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;362</td> <td class="nbHitsCovered">&nbsp;6</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">return</span> artifactResponse.getMessage();</pre></td></tr>
<tr> <td class="numLine">&nbsp;363</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;364</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;365</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">/**</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;366</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * Send a single SAML-standard authorization request.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;367</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> *</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;368</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * @param urlString The URL for which access is being authorized.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;369</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * @param username The username to test for access.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;370</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * @return The authorization status.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;371</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * @throws IOException if there are any I/O errors during authorization.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;372</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;373</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">public</span> AuthzStatus sendAuthzRequest(String urlString, String username)</pre></td></tr>
<tr> <td class="numLine">&nbsp;374</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">throws</span> IOException {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;375</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; Preconditions.checkNotNull(urlString);</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;376</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; Preconditions.checkNotNull(username);</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;377</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;378</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; SAMLMessageContext&lt;Response, AuthzDecisionQuery, NameID&gt; context = makeAuthzContext();</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;379</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; HttpExchange exchange = makeAuthzExchange(context);</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;380</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">try</span> {</pre></td></tr>
<tr> <td class="numLine">&nbsp;381</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;382</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; HttpExchangeToOutTransport out = <span class="keyword">new</span> HttpExchangeToOutTransport(exchange);</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;383</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; setupAuthzQuery(context, urlString, username, <span class="keyword">new</span> DateTime(), out, <span class="keyword">new</span> HTTPSOAP11Encoder());</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;384</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; out.finish();</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;385</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;386</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// Do HTTP exchange</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;387</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">int</span> status = exchange.exchange();</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;388</td> <td class="nbHitsUncovered"><a title="Line 388: Conditional coverage 0% (0/2).">&nbsp;0</a></td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<a title="Line 388: Conditional coverage 0% (0/2)."> <span class="keyword">if</span> (!isGoodHttpStatus(status)) {</a></span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;389</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">throw</span> <span class="keyword">new</span> IOException(<span class="string">"Incorrect HTTP status: "</span> + status);</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;390</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;391</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;392</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// Decode the response</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;393</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; HttpExchangeToInTransport in = <span class="keyword">new</span> HttpExchangeToInTransport(exchange);</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;394</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; context.setInboundMessageTransport(in);</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;395</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; runDecoder(<span class="keyword">new</span> HTTPSOAP11Decoder(), context);</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;396</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;397</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; } <span class="keyword">finally</span> {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;398</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; exchange.close();</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;399</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; }</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;400</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;401</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; DecodedAuthzResponse response = decodeAuthzResponse(context.getInboundSAMLMessage(), username);</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;402</td> <td class="nbHitsUncovered"><a title="Line 402: Conditional coverage 0% (0/2).">&nbsp;0</a></td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<a title="Line 402: Conditional coverage 0% (0/2)."> <span class="keyword">if</span> (response == <span class="keyword">null</span>) {</a></span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;403</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">return</span> AuthzStatus.INDETERMINATE;</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;404</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;405</td> <td class="nbHitsUncovered"><a title="Line 405: Conditional coverage 0% (0/2).">&nbsp;0</a></td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<a title="Line 405: Conditional coverage 0% (0/2)."> <span class="keyword">if</span> (!urlString.equals(response.resource)) {</a></span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;406</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">throw</span> <span class="keyword">new</span> IOException(<span class="string">"Wrong resource received (expected '"</span> + urlString</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;407</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; + <span class="string">"'): '"</span> + response.resource + <span class="string">"'"</span>);</pre></td></tr>
<tr> <td class="numLine">&nbsp;408</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;409</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">return</span> response.status;</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;410</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;411</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;412</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">/**</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;413</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * Send a (nonstandard) multiple SAML authorization request.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;414</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> *</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;415</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * @param urlStrings The URLs for which access is being authorized.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;416</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * @param username The username to test for access.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;417</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * @return The authorization responses.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;418</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * @throws IOException if there are any I/O errors during authorization.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;419</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;420</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">public</span> AuthzResult sendMultiAuthzRequest(Collection&lt;String&gt; urlStrings,</pre></td></tr>
<tr> <td class="numLine">&nbsp;421</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; String username)</pre></td></tr>
<tr> <td class="numLine">&nbsp;422</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">throws</span> IOException {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;423</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; Preconditions.checkNotNull(urlStrings);</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;424</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; Preconditions.checkNotNull(username);</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;425</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;426</td> <td class="nbHitsUncovered"><a title="Line 426: Conditional coverage 0% (0/2).">&nbsp;0</a></td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<a title="Line 426: Conditional coverage 0% (0/2)."> <span class="keyword">if</span> (urlStrings.isEmpty()) {</a></span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;427</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">return</span> AuthzResult.makeIndeterminate(urlStrings);</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;428</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;429</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;430</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// Establish the SAML message context.</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;431</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; SAMLMessageContext&lt;Response, AuthzDecisionQuery, NameID&gt; context = makeAuthzContext();</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;432</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;433</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; HTTPSOAP11MultiContextEncoder encoder = <span class="keyword">new</span> HTTPSOAP11MultiContextEncoder();</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;434</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; HttpExchange exchange = makeAuthzExchange(context);</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;435</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">try</span> {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;436</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; HttpExchangeToOutTransport out = <span class="keyword">new</span> HttpExchangeToOutTransport(exchange);</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;437</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; DateTime now = <span class="keyword">new</span> DateTime();</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;438</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;439</td> <td class="nbHitsUncovered"><a title="Line 439: Conditional coverage 0% (0/2).">&nbsp;0</a></td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<a title="Line 439: Conditional coverage 0% (0/2)."> <span class="keyword">for</span> (String urlString : urlStrings) {</a></span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;440</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; setupAuthzQuery(context, urlString, username, now, out, encoder);</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;441</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;442</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">try</span> {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;443</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; encoder.finish();</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;444</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; } <span class="keyword">catch</span> (MessageEncodingException e) {</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;445</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">throw</span> <span class="keyword">new</span> IOException(e);</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;446</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; }</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;447</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; out.finish();</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;448</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;449</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// Do HTTP exchange</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;450</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">int</span> status = exchange.exchange();</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;451</td> <td class="nbHitsUncovered"><a title="Line 451: Conditional coverage 0% (0/2).">&nbsp;0</a></td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<a title="Line 451: Conditional coverage 0% (0/2)."> <span class="keyword">if</span> (!isGoodHttpStatus(status)) {</a></span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;452</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">throw</span> <span class="keyword">new</span> IOException(<span class="string">"Incorrect HTTP status: "</span> + status);</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;453</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;454</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;455</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// Decode the responses</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;456</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; HttpExchangeToInTransport in = <span class="keyword">new</span> HttpExchangeToInTransport(exchange);</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;457</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; context.setInboundMessageTransport(in);</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;458</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; HTTPSOAP11MultiContextDecoder decoder = <span class="keyword">new</span> HTTPSOAP11MultiContextDecoder();</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;459</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;460</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; AuthzResult.Builder builder = AuthzResult.builder(urlStrings);</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;461</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">while</span> (<span class="keyword">true</span>) {</pre></td></tr>
<tr> <td class="numLine">&nbsp;462</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">try</span> {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;463</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; runDecoder(decoder, context);</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;464</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; } <span class="keyword">catch</span> (IndexOutOfBoundsException e) {</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;465</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// normal indication that there are no more messages to decode</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;466</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">break</span>;</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;467</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; }</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;468</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; DecodedAuthzResponse response</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;469</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; = decodeAuthzResponse(context.getInboundSAMLMessage(), username);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;470</td> <td class="nbHitsUncovered"><a title="Line 470: Conditional coverage 0% (0/2).">&nbsp;0</a></td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<a title="Line 470: Conditional coverage 0% (0/2)."> <span class="keyword">if</span> (response != <span class="keyword">null</span>) {</a></span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;471</td> <td class="nbHitsUncovered"><a title="Line 471: Conditional coverage 0% (0/2).">&nbsp;0</a></td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<a title="Line 471: Conditional coverage 0% (0/2)."> <span class="keyword">if</span> (urlStrings.contains(response.resource)) {</a></span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;472</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; builder.put(response.resource, response.status);</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;473</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; } <span class="keyword">else</span> {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;474</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; LOGGER.warning(<span class="string">"Unknown resource received: '"</span> + response.resource + <span class="string">"'"</span>);</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;475</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;476</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;477</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; }</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;478</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">return</span> builder.build();</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;479</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;480</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; } <span class="keyword">finally</span> {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;481</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; exchange.close();</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;482</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;483</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;484</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;485</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> SAMLMessageContext&lt;Response, AuthzDecisionQuery, NameID&gt; makeAuthzContext() {</pre></td></tr>
<tr> <td class="numLine">&nbsp;486</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// Establish the SAML message context.</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;487</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; SAMLMessageContext&lt;Response, AuthzDecisionQuery, NameID&gt; context = makeSamlMessageContext();</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;488</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; initializeLocalEntity(context, localEntity);</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;489</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; initializePeerEntity(context, peerEntity,</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;490</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; peerEntity.getPDPDescriptor(SAMLConstants.SAML20P_NS),</pre></td></tr>
<tr> <td class="numLine">&nbsp;491</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; AuthzService.DEFAULT_ELEMENT_NAME,</pre></td></tr>
<tr> <td class="numLine">&nbsp;492</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; SAML2_SOAP11_BINDING_URI);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;493</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">return</span> context;</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;494</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;495</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;496</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> HttpExchange makeAuthzExchange(</pre></td></tr>
<tr> <td class="numLine">&nbsp;497</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; SAMLMessageContext&lt;Response, AuthzDecisionQuery, NameID&gt; context)</pre></td></tr>
<tr> <td class="numLine">&nbsp;498</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">throws</span> IOException {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;499</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">return</span> httpClient.postExchange(<span class="keyword">new</span> URL(context.getPeerEntityEndpoint().getLocation()), <span class="keyword">null</span>);</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;500</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;501</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;502</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> <span class="keyword">void</span> setupAuthzQuery(SAMLMessageContext&lt;Response, AuthzDecisionQuery, NameID&gt; context,</pre></td></tr>
<tr> <td class="numLine">&nbsp;503</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; String urlString, String username, DateTime instant, HTTPOutTransport out,</pre></td></tr>
<tr> <td class="numLine">&nbsp;504</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; MessageEncoder encoder)</pre></td></tr>
<tr> <td class="numLine">&nbsp;505</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">throws</span> IOException {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;506</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; AuthzDecisionQuery query</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;507</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; = makeAuthzDecisionQuery(</pre></td></tr>
<tr> <td class="numLine">&nbsp;508</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; context.getOutboundMessageIssuer(),</pre></td></tr>
<tr> <td class="numLine">&nbsp;509</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; instant,</pre></td></tr>
<tr> <td class="numLine">&nbsp;510</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; makeSubject(username),</pre></td></tr>
<tr> <td class="numLine">&nbsp;511</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; urlString,</pre></td></tr>
<tr> <td class="numLine">&nbsp;512</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; makeAction(Action.HTTP_GET_ACTION, Action.GHPP_NS_URI));</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;513</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; LOGGER.info(SamlLogUtil.xmlMessage(<span class="string">"AuthzDecisionQuery"</span>, query));</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;514</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; context.setOutboundSAMLMessage(query);</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;515</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; context.setOutboundMessageTransport(out);</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;516</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; runEncoder(encoder, context);</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;517</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; }</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;518</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;519</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> DecodedAuthzResponse decodeAuthzResponse(Response response, String username)</pre></td></tr>
<tr> <td class="numLine">&nbsp;520</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">throws</span> IOException {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;521</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; LOGGER.info(SamlLogUtil.xmlMessage(<span class="string">"response"</span>, response));</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;522</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;523</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; String statusValue = response.getStatus().getStatusCode().getValue();</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;524</td> <td class="nbHitsUncovered"><a title="Line 524: Conditional coverage 0% (0/2).">&nbsp;0</a></td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<a title="Line 524: Conditional coverage 0% (0/2)."> <span class="keyword">if</span> (!StatusCode.SUCCESS_URI.equals(statusValue)) {</a></span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;525</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; LOGGER.info(<span class="string">"Unsuccessful response received: "</span> + statusValue);</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;526</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">return</span> <span class="keyword">null</span>;</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;527</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;528</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;529</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; List&lt;Assertion&gt; assertions = response.getAssertions();</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;530</td> <td class="nbHitsUncovered"><a title="Line 530: Conditional coverage 0% (0/2).">&nbsp;0</a></td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<a title="Line 530: Conditional coverage 0% (0/2)."> <span class="keyword">if</span> (assertions.size() != 1) {</a></span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;531</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; LOGGER.warning(<span class="string">"Wrong number of assertions received (expected 1): "</span> + assertions.size());</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;532</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">return</span> <span class="keyword">null</span>;</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;533</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;534</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; Assertion assertion = assertions.get(0);</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;535</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;536</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; String responseUsername = assertion.getSubject().getNameID().getValue();</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;537</td> <td class="nbHitsUncovered"><a title="Line 537: Conditional coverage 0% (0/2).">&nbsp;0</a></td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<a title="Line 537: Conditional coverage 0% (0/2)."> <span class="keyword">if</span> (!username.equals(responseUsername)) {</a></span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;538</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; LOGGER.warning(<span class="string">"Wrong username received (expected '"</span> + username + <span class="string">"'): '"</span></span></pre></td></tr>
<tr> <td class="numLine">&nbsp;539</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; + responseUsername + <span class="string">"'"</span>);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;540</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">return</span> <span class="keyword">null</span>;</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;541</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;542</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;543</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; List&lt;Statement&gt; statements = assertion.getStatements();</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;544</td> <td class="nbHitsUncovered"><a title="Line 544: Conditional coverage 0% (0/2).">&nbsp;0</a></td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<a title="Line 544: Conditional coverage 0% (0/2)."> <span class="keyword">if</span> (statements.size() != 1) {</a></span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;545</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; LOGGER.warning(<span class="string">"Wrong number of statements received (expected 1): "</span> + statements.size());</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;546</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">return</span> <span class="keyword">null</span>;</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;547</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;548</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; Statement statement = statements.get(0);</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;549</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;550</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; AuthzDecisionStatement authzDecisionStatement = AuthzDecisionStatement.<span class="keyword">class</span>.cast(statement);</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;551</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">return</span> <span class="keyword">new</span> DecodedAuthzResponse(</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;552</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; authzDecisionStatement.getResource(),</pre></td></tr>
<tr> <td class="numLine">&nbsp;553</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; mapDecision(authzDecisionStatement.getDecision()));</pre></td></tr>
<tr> <td class="numLine">&nbsp;554</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;555</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;556</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> <span class="keyword">static</span> <span class="keyword">final</span> <span class="keyword">class</span> DecodedAuthzResponse {</pre></td></tr>
<tr> <td class="numLine">&nbsp;557</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">public</span> <span class="keyword">final</span> String resource;</pre></td></tr>
<tr> <td class="numLine">&nbsp;558</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">public</span> <span class="keyword">final</span> AuthzStatus status;</pre></td></tr>
<tr> <td class="numLine">&nbsp;559</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;560</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">public</span> DecodedAuthzResponse(String resource, AuthzStatus status) {</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;561</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">this</span>.resource = resource;</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;562</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">this</span>.status = status;</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;563</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; }</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;564</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;565</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;566</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> AuthzStatus mapDecision(DecisionTypeEnumeration decision) {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;567</td> <td class="nbHitsUncovered"><a title="Line 567: Conditional coverage 0% (0/2).">&nbsp;0</a></td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<a title="Line 567: Conditional coverage 0% (0/2)."> <span class="keyword">if</span> (decision == DecisionTypeEnumeration.PERMIT) {</a></span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;568</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">return</span> AuthzStatus.PERMIT;</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;569</td> <td class="nbHitsUncovered"><a title="Line 569: Conditional coverage 0% (0/2).">&nbsp;0</a></td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<a title="Line 569: Conditional coverage 0% (0/2)."> } <span class="keyword">else</span> <span class="keyword">if</span> (decision == DecisionTypeEnumeration.DENY) {</a></span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;570</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">return</span> AuthzStatus.DENY;</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;571</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; } <span class="keyword">else</span> {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;572</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">return</span> AuthzStatus.INDETERMINATE;</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;573</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;574</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;575</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;576</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">/**</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;577</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * A tweaked redirect encoder that preserves query parameters from the endpoint URL.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;578</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;579</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> <span class="keyword">static</span> <span class="keyword">final</span> <span class="keyword">class</span> RedirectEncoder <span class="keyword">extends</span> HTTPRedirectDeflateEncoder {</pre></td></tr>
<tr> <td class="numLine">&nbsp;580</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;581</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; RedirectEncoder() {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;582</td> <td class="nbHitsCovered">&nbsp;10</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">super</span>();</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;583</td> <td class="nbHitsCovered">&nbsp;10</td> <td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;584</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;585</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class=