2017 © Pedro Peláez
 

library zf2-saml

SAML Authentication module for ZF-2.

image

mehr-als-nix/zf2-saml

SAML Authentication module for ZF-2.

  • Saturday, October 15, 2016
  • by siad007
  • Repository
  • 2 Watchers
  • 1 Stars
  • 59 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 5 % Grown

The README.md

zf-saml

SAML authentication module for ZF2., (*1)

Build Status, (*2)

This module uses onelogin/php-saml internally and wrap the function in services., (*3)

Installation

Just require mehr-als-nix/zf-saml in your composer.json., (*4)

Enable it in application.config.php, (*5)

    'modules' => array (
        // ---8<---
        'ZF\ApiProblem',
        'ZF\ContentNegotiation',
        'MehrAlsNix\ZF\SAML',
        // --->8---
    ),

Configuration

Copy saml.local.php.dist to config/autoload/saml.local.php, (*6)

Services

MehrAlsNix\ZF\SAML\Service\SAML2Auth

Provides an instance of OneLogin_Saml2_Auth, (*7)

MehrAlsNix\ZF\SAML\Service\SAML2AuthnRequest

Provides an instance of OneLogin_Saml2_AuthnRequest, (*8)

MehrAlsNix\ZF\SAML\Service\SAML2Metadata

Provides an instance of OneLogin_Saml2_Metadata, (*9)

MehrAlsNix\ZF\SAML\Service\SAML2Response

Provides an instance of OneLogin_Saml2_Response, (*10)

MehrAlsNix\ZF\SAML\Service\SAML2Settings

Provides an instance of OneLogin_Saml2_Settings, (*11)

API protection

Assume $this->samlAuth contains an instance of OneLogin_Saml2_Auth, then you would be able to protect your API., (*12)

    if (!$this->samlAuth->isAuthenticated()) {
        $this->getResponse()->setStatusCode(401);
        return;
    }

The Versions