title: How to create a HTTPURLResponse from wkwebview to end the authentication in sso extension
body: <p>With the help <a href="https://developer.apple.com/videos/play/tech-talks/301/" rel="nofollow noreferrer">https://developer.apple.com/videos/play/tech-talks/301/</a> video or AuthenticationServices extension we are trying to implement the enterprise sso extension. We are able to complete the authentication flow in WKWebview and using apps url scheme we can close the authentication flow also in extension. But how to create the HTTPURLResponse in</p>
  <blockquote>
  <p>func webView(_ webView: WKWebView, decidePolicyFor navigationAction:
  WKNavigationAction, decisionHandler: (WKNavigationActionPolicy) -&gt;
  Void)</p>
  </blockquote>
  <p>to send the response back to target app from which authentication started.</p>
  <pre><code>open func complete(httpResponse: HTTPURLResponse, httpBody: Data?)
  </code></pre>
  <p>According to apple for SAML2.0 based idps, we need to use above method to complete the authentication but it requires the HTTPURLResponse and body data that we are not sure from where we can get it from WKWebView in which we are trying to complete the authentication.</p>