attek / ptesaml
PTE simple SAML login
1.0.9
2018-11-26 14:30 UTC
Requires
- yiisoft/yii2: ~2.0.0
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
PTE Saml Login
Installation
The preferred way to install this extension is through composer.
To install, either run
composer require attek/ptesaml "1.*"
or add
"attek/ptesaml" : "1.*"
or clone form github
git clone https://github.com/Attek/ptesaml
Usage
Set in config file (web.php)
'components' => [ 'saml' => [ 'class' => 'attek\ptesaml\Saml', 'simpleSamlPath' => '/usr/share/simplesamlphp/', 'config' => 'default-sp' ] ]
Use in code
$saml = Yii::$app->saml; //check is authenticated $saml->isAuthenticated(); //Login $saml->requireAuth(); $saml->getAttributes(); $saml->logout(); $saml->getSamlUser();
Login button
<?php
use attek\ptesaml\SamlAsset;
/* @var yii\web\View $this */
SamlAsset::register($this);
?>
<?= Html::a(Yii::t('app', 'Login'), ['saml'], ['class' => 'btn btn-primary pte-login']) ?>