PHP code example of conf09 / saml2-bearer

1. Go to this page and download the library: Download conf09/saml2-bearer library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

conf09 / saml2-bearer example snippets


'providers' => [
        ...
    	Saml\Bearer\Saml2BearerServiceProvider::class,
]

//this enable authentication if not authenticate in application

$saml2Bearer = Saml2Bearer::make();

return $saml2Bearer->getSamlAuth()->login(URL::full());

Event::listen(Saml2LoginEvent::class, function (Saml2LoginEvent $event) {
    // your logic application here
});

shell
php artisan vendor:publish --provider="Saml\Bearer\Saml2BearerServiceProvider"