attek / ptesaml
PTE simple SAML login
Installs: 1 043
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- yiisoft/yii2: ~2.0.0
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']) ?>