dev-master
9999999-devA SAML SSO extension for Yii 2
The Requires
by QuartSoft Ltd.
saml yii2 samlsso
Wallogit.com
2017 © Pedro Peláez
A SAML SSO extension for Yii 2
Connect Yii 2 application to a Saml Identity Provider for Single Sign On, (*1)
The preferred way to install this extension is through composer., (*2)
Later run, (*3)
php composer.phar require --prefer-dist quartsoft/samlsso "dev-master"
or add, (*4)
"quartsoft/samlsso": "dev-master"
to the require section of your composer.json file., (*5)
Register quartsoft\samlsso\Saml to your components in config/web.php., (*6)
'components' => [
'samlsso' => [
'class' => 'quartsoft\samlsso\Samlsso',
'configFile' => '@common/config/samlcofig.php' // OneLogin_Saml config file (Optional)
]
]
This component requires a OneLogin_Saml configuration stored in a php file. The default value for configFile is @common/config/samlcofig.php so make sure to create this file before. This file must returns the OneLogin_Saml configuration. See this link for example configuration., (*7)
<?php
return [
'sp' => [
'entityId' => '',
'assertionConsumerService' => [
'url' => '',
'binding' => '',
],
'singleLogoutService' => [
'url' => '',
'binding' => '',
]
],
'idp' => [
'entityId' => '',
'singleSignOnService' => [
'url' => '',
'binding' => '',
],
'singleLogoutService' => [
'url' => '',
'binding' => '',
],
'x509cert' => '',
],
];
Example configuration file you can find here., (*8)
Your controller, where you use actionLogin must be inherited from SamlController. And add array_merge in method actions()., (*9)
use quartsoft\samlsso\controllers\SamlController; class SiteController extends SamlController { ... public function actions() { $actions = parent::actions(); $currentActions = [ 'your action' => [ 'class' => 'your class', ], ... ]; return array_merge($actions, $currentActions); } ... }
For more information see onelogin/php-saml library ., (*10)
A SAML SSO extension for Yii 2
saml yii2 samlsso