public static function Utilities::Print_SAML_Request in SAML SP 2.0 Single Sign On (SSO) - SAML Service Provider 8
2 calls to Utilities::Print_SAML_Request()
- MiniOrangeAcs::processSamlResponse in src/
MiniOrangeAcs.php - The function processSamlResponse.
- MiniOrangeAuthnRequest::initiateLogin in src/
MiniOrangeAuthnRequest.php
File
- src/
Utilities.php, line 621
Class
- Utilities
- This file is part of miniOrange SAML plugin.
Namespace
Drupal\miniorange_samlCode
public static function Print_SAML_Request($samlRequestResponceXML, $type) {
header("Content-Type: text/html");
$doc = new \DOMDocument();
$doc->preserveWhiteSpace = false;
$doc->formatOutput = true;
$doc
->loadXML($samlRequestResponceXML);
if ($type == 'displaySAMLRequest') {
$show_value = 'SAML Request';
}
else {
$show_value = 'SAML Response';
}
$out = $doc
->saveXML();
$out1 = htmlentities($out);
$out1 = rtrim($out1);
$xml = simplexml_load_string($out);
$json = json_encode($xml);
$array = json_decode($json);
$url = \Drupal::service('extension.list.module')
->getPath('miniorange_saml') . '/css/miniorange_saml.module.css';
$jsurl = \Drupal::service('extension.list.module')
->getPath('miniorange_saml') . '/js/showSAMLResponse.js';
echo '<link rel=\'stylesheet\' id=\'mo_saml_admin_settings_style-css\' href=\'' . $url . '\' type=\'text/css\' media=\'all\' />
<script src=\'' . $jsurl . '\'></script>
<div class="mo-display-logs" ><p type="text" id="SAML_type">' . $show_value . '</p></div>
<div type="text" id="SAML_display" class="mo-display-block"><pre class=\'brush: xml;\'>' . $out1 . '</pre></div>
<br>
<div style="margin:3%;display:block;text-align:center;">
<div style="margin:3%;display:block;text-align:center;" >
</div>
<button id="copy" onclick="copyDivToClipboard()" style="padding:1%;width:100px;background: #0091CD none repeat scroll 0% 0%;cursor: pointer;font-size:15px;border-width: 1px;border-style: solid;border-radius: 3px;white-space: nowrap;box-sizing: border-box;border-color: #0073AA;box-shadow: 0px 1px 0px rgba(120, 200, 230, 0.6) inset;color: #FFF;" >Copy</button>
<button id="dwn_btn" onclick="test_download()" style="padding:1%;width:100px;background: #0091CD none repeat scroll 0% 0%;cursor: pointer;font-size:15px;border-width: 1px;border-style: solid;border-radius: 3px;white-space: nowrap;box-sizing: border-box;border-color: #0073AA;box-shadow: 0px 1px 0px rgba(120, 200, 230, 0.6) inset;color: #FFF;">Download</button>
</div>
</div>
';
exit;
}