PHPackages                             visyon360/authsaml2-module - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. visyon360/authsaml2-module

ActiveLaravel-module[Authentication &amp; Authorization](/categories/authentication)

visyon360/authsaml2-module
==========================

00PHP

Since Nov 26Pushed 4y ago1 watchersCompare

[ Source](https://github.com/visyon360/authsaml2-module)[ Packagist](https://packagist.org/packages/visyon360/authsaml2-module)[ RSS](/packages/visyon360-authsaml2-module/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

 Table of Contents1. [Descripcion](#acerca-del-proyecto)
    - [Built With](#built-with)
2. [Getting Started](#getting-started)
    - [Prerequisites](#prerequisites)
    - [Installation](#installation)
3. [Uso](#uso)
4. [Contacto](#contacto)

Acerca del proyecto
-------------------

[](#acerca-del-proyecto)

Paquete composer Auth-saml2 para starter de Visyon360.

Getting Started
---------------

[](#getting-started)

### Prerequisitos

[](#prerequisitos)

Composer 2.0 será necesario para la correcta instalación de este paquete

### Installation &amp; SAML Configuration

[](#installation--saml-configuration)

[aacotroneo/laravel-saml2](https://github.com/aacotroneo/laravel-saml2)

1. The configuration of the SAML implementation it is done with the next library (for more information you could look for it at documentation library site): [aacotroneo/laravel-saml2](https://github.com/aacotroneo/laravel-saml2) To implement this library we will install package via composer:

    ```
    composer require visyon360/authsaml2-module
    ```
2. Then you must publish the config files with:

    ```
    php artisan vendor:publish --provider="Aacotroneo\Saml2\Saml2ServiceProvider"
    ```
3. You will need to configure your Service Provider and your Identity Provider(s). We will act as Service Provider role, and the main functionality of that is almost done by default but, if you want, you could modify that information with your needs (if we change the ACS and the SLS URLs we will have to notify the IP with the changes). In order to configure the properties of the SP and IP you must change on config/saml2\_settings. Add the name of the Controller in thge Module:

    ```
    'saml2_controller' => 'Modules\AuthSaml2\Http\Controllers\AuthController',
    ```
4. And then add the others idp that the proyect requires, for example:

    ```
    'idpNames' => ['develop','staging','metaverso'],
    ```
5. Then we need to create in the config/saml2 folder, all of idp's configuration files like for example develop\_idp\_settings.php, in this file we must change all the setting properties that you have to adapt. For example at the 'sp' array you will have the Service Provider properties:

    ```
     'sp' => array(
            'NameIDFormat' => 'urn:oasis:names:tc:SAML:2.0:nameid-format:transient',
            'x509cert' => env('SAML2_'.$this_idp_env_id.'_SP_x509',''),
            'privateKey' => env('SAML2_'.$this_idp_env_id.'_SP_PRIVATEKEY',''),
            'entityId' => env('SAML2_'.$this_idp_env_id.'_SP_ENTITYID',''),
            'assertionConsumerService' => array(
                'url' => '',
            ),
            'singleLogoutService' => array(
                'url' => '',
            ),
    ```
6. The 'NameIDFormat' is the format of the identifier of requested subject. You must have the same as the Identity Provider. Certs are not need by default at Service Provider. The 'entityID' is the URI which identifies the identity of Service Provider (blank by default). 'ACS' and 'SLS' are the URL from callbacks response from the IP for login and logout, respectively (blank by default). At 'idp' array you will have the Identity Provider properties:

    ```
        'idp' => array(
            'entityId' => env('SAML2_'.$this_idp_env_id.'_IDP_ENTITYID', $idp_host . '/saml2/idp/metadata.php'),
            'singleSignOnService' => array(
                'url' => env('SAML2_'.$this_idp_env_id.'_IDP_SSO_URL', $idp_host . '/saml2/idp/SSOService.php'),
            ),
            'singleLogoutService' => array(
                'url' => env('SAML2_'.$this_idp_env_id.'_IDP_SL_URL', $idp_host . '/saml2/idp/SingleLogoutService.php'),
            ),
            'x509cert' => env('SAML2_'.$this_idp_env_id.'_IDP_x509', 'MIID/TCCAuWgAwIBAgIJAI4R3WyjjmB1MA0GCSqGSIb3DQEBCwUAMIGUMQswCQYDVQQGEwJBUjEVMBMGA1UECAwMQnVlbm9zIEFpcmVzMRUwEwYDVQQHDAxCdWVub3MgQWlyZXMxDDAKBgNVBAoMA1NJVTERMA8GA1UECwwIU2lzdGVtYXMxFDASBg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KXX3KTD9lIILmX5yUC3dLgjVKi1KGDqNApYGOMtjr5eoxPQrqDBmyx3flcy0dQTdLXud3UjWVW3N0PYgJtw5yBsS74QTGD4='),
        ),
    ```
7. The 'entityID' is the URI which identifies the Identity Provider identity. 'SSOS' and 'SLS' are the URL endpoints from login and logout from the Identity Provider, respectively. The cert, in this case, is needed to authenticate from the IP. The environment variables that you need to add are these:

    ```
    FRONTEND_URL=
    SAML2_DEVELOP_IDP_HOST=
    SAML2_DEVELOP_IDP_x509=
    ```

    We must change the idp name when we are in a different environment, like if we are using this in staging, the name of the variable it must be SAML2\_STAGING\_IDP\_HOST and SAML2\_STAGING\_IDP\_x509.

Usage
-----

[](#usage)

At config/saml2\_settings.php you could change the routes, and the controller flow for the SAML2 implementation. If you leave it blank the default URLs will be the used. In this case, we are using the UserController as SAML2Controller.

There are four methods and routes that we must keep in mind, the login (login and acs) and the logout (logout and sls) ones. When you want to login, you are redirected to login method:

```
public function login(Saml2Auth $saml2Auth)
{
    $saml2Auth->login(config('saml2_settings.loginRoute'));
}
```

When the login finish, the user will be redirected to acs method. On this method, we have the status of the authentication, and the user data if it is logged correctly. If we need change some Atributtes of the user object returned by the idp, those are in the method getUser() over the LoginUserService class in the same name file on Modules\\AuthSaml2\\Services route. The logout methods works exactly as the login methods, you can control the user before doing the request and after receiving the response.

Contacto
--------

[](#contacto)

Juan Alberto Zamarbide - Project Link:

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity28

Early-stage or recently created project

 Bus Factor1

Top contributor holds 66.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/08ebe72b06482c1d0dacd175f683a6e78cf0426d8bffd4bb8ffe504ea0ceb588?d=identicon)[visyon360](/maintainers/visyon360)

---

Top Contributors

[![albarra77](https://avatars.githubusercontent.com/u/22679784?v=4)](https://github.com/albarra77 "albarra77 (2 commits)")[![visyon360](https://avatars.githubusercontent.com/u/23380924?v=4)](https://github.com/visyon360 "visyon360 (1 commits)")

### Embed Badge

![Health badge](/badges/visyon360-authsaml2-module/health.svg)

```
[![Health](https://phpackages.com/badges/visyon360-authsaml2-module/health.svg)](https://phpackages.com/packages/visyon360-authsaml2-module)
```

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[league/oauth2-google

Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client

41721.2M118](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
