Fabian Peter Hammerle 076e868248 composer.json: added keywords and license | 7 years ago | |
---|---|---|
migrations | 7 years ago | |
tests | 7 years ago | |
.gitignore | 7 years ago | |
.travis.yml | 7 years ago | |
Authenticator.php | 7 years ago | |
LICENSE | 7 years ago | |
README.md | 7 years ago | |
Subject.php | 7 years ago | |
composer.json | 7 years ago | |
phpunit.xml | 7 years ago |
yii2 extension for automatic login via TLS/SSL/HTTPS client certificates
<VirtualHost example.hammerle.me:443>
# ...
SSLEngine on
SSLCertificateFile /etc/somewhere/example-server-cert.pem
SSLCertificateKeyFile /etc/restricted/example-server-key.pem
SSLVerifyClient optional
SSLVerifyDepth 1
SSLCACertificateFile /etc/somewhere/example-client-cert-ca.pem
SSLOptions +StdEnvVars
</VirtualHost>
composer require fphammerle/yii2-client-cert-auth
./yii migrate --migrationPath=./vendor/fphammerle/yii2-client-cert-auth/migrations
$config = [
// ...
'bootstrap' => ['clientCertAuth'],
'components' => [
// ...
'clientCertAuth' => \fphammerle\yii2\auth\clientcert\Authenticator::className(),
],
// ...
];
$subj = new \fphammerle\yii2\auth\clientCert\Subject;
$subj->identity = \Yii::$app->user->identity;
$subj->distinguished_name = "CN=Fabian,C=AT";
$subj->save();