attek/ptesaml

PTE simple SAML login

Maintainers

Details

github.com/Attek/ptesaml

Source

Issues

Installs: 925

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Type:yii2-extension

1.0.9 2018-11-26 14:30 UTC

This package is not auto-updated.

Last update: 2024-05-25 17:59:43 UTC


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']) ?>