2017 © Pedro Peláez
 

library samlsso

A SAML SSO extension for Yii 2

image

quartsoft/samlsso

A SAML SSO extension for Yii 2

  • Monday, February 27, 2017
  • by Erlang333
  • Repository
  • 1 Watchers
  • 0 Stars
  • 47 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Yii 2 Saml

Connect Yii 2 application to a Saml Identity Provider for Single Sign On, (*1)

Installation

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)

Configuration

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)

Usage

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); } ... }

Finally

For more information see onelogin/php-saml library ., (*10)

The Versions

27/02 2017

dev-master

9999999-dev

A SAML SSO extension for Yii 2

  Sources   Download

The Requires

 

by QuartSoft Ltd.

saml yii2 samlsso