Skip to content

Instantly share code, notes, and snippets.

@Gunni
Created March 2, 2017 23:05
Show Gist options
  • Save Gunni/45cc753d55901e327dcf350546467889 to your computer and use it in GitHub Desktop.
Save Gunni/45cc753d55901e327dcf350546467889 to your computer and use it in GitHub Desktop.
html/includes/authentication/client-cert.inc.php
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage authentication
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited
*
*/
if (!$_SESSION['authenticated'] && !is_cli())
{
if ($_SERVER['SSL_CLIENT_VERIFY'] == 'SUCCESS')
{
// Just getting here means authentication succeeded
$_SESSION['authenticated'] = TRUE;
$_SESSION['username'] = $_SERVER['SSL_CLIENT_S_DN_CN'];
}
}
// EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment