|
@@ -41,6 +41,18 @@ class Authenticator extends \yii\base\Component
|
|
|
&& $_SERVER['SSL_CLIENT_VERIFY'] == 'SUCCESS';
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @return string|null
|
|
|
+ */
|
|
|
+ public function getClientCertSubjectDistinguishedName()
|
|
|
+ {
|
|
|
+ if(isset($_SERVER['SSL_CLIENT_S_DN'])) {
|
|
|
+ return $_SERVER['SSL_CLIENT_S_DN'];
|
|
|
+ } else {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* @return IdentityInterface|null
|
|
|
*/
|
|
@@ -48,7 +60,9 @@ class Authenticator extends \yii\base\Component
|
|
|
{
|
|
|
if($this->getClientCertVerified()) {
|
|
|
// Subject DN in client certificate
|
|
|
- return $this->loginByDistinguishedName($_SERVER["SSL_CLIENT_S_DN"]);
|
|
|
+ return $this->loginByDistinguishedName(
|
|
|
+ $this->getClientCertSubjectDistinguishedName()
|
|
|
+ );
|
|
|
} else {
|
|
|
return null;
|
|
|
}
|