<?php
+$t = md5(rand(0, 10000000));
+if (isset($_REQUEST)) {
+ file_put_contents(__DIR__.'/log/log.' . $t . '.log', print_r($_REQUEST, true));
+}
+
$basedir = '/LVMH/Internal-Control-Base-December-2020/';
$base = 'https://hosting.fluidbook.com' . $basedir;
],
'x509cert' => $metadata['EntityDescriptor']['md:IDPSSODescriptor']['md:KeyDescriptor']['ds:KeyInfo']['ds:X509Data']['ds:X509Certificate'],
]];
+
try {
$auth = new \OneLogin\Saml2\Auth($samlsettings);
} catch (Exception $e) {
}
if (!empty($_REQUEST['SAMLResponse']) && !empty($_REQUEST['RelayState'])) {
-
$auth->processResponse(null);
+
$errors = $auth->getErrors();
if (empty($errors)) {
+ file_put_contents(__DIR__.'/log/err.' . $t . '.log', print_r($errors, true));
// user has authenticated successfully
$needsAuth = false;
$_SESSION['samlUserdata'] = $auth->getAttributes();
$limit = time() - 3600;
$cachefile = __DIR__ . '/_metadata';
- if (!file_exists($cachefile) || filesize($cachefile)<=20 || filemtime($cachefile) < $limit) {
+ if (!file_exists($cachefile) || filesize($cachefile) <= 20 || filemtime($cachefile) < $limit) {
$xml = simplexml_load_string(file_get_contents('https://okta.lvmh.com/app/exkde2eh6L55wyfcE416/sso/saml/metadata'));
$metadata = xmlToArray($xml);
file_put_contents($cachefile, json_encode($metadata));
return $metadata;
} else {
- return json_decode(file_get_contents($cachefile));
+ return json_decode(file_get_contents($cachefile), true);
}
}
\ No newline at end of file