PHP code example of vircom / epuap2

1. Go to this page and download the library: Download vircom/epuap2 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/ */

    

vircom / epuap2 example snippets




use VirCom\ePUAP2\AuthenticationFactory;
use VirCom\ePUAP2\Requests\Login;

$factory = new AuthenticationFactory();
$service = $factory->createService();

$url = $service->getLoginUrl(
    new Login(
        'https://hetmantest.epuap.gov.pl/DracoEngine2/draco.jsf',
        'http://your.application.url',
        '/your.application.id'
    )
);

header('Location: ' . $url);
exit();


use VirCom\ePUAP2\AuthenticationFactory;
use VirCom\ePUAP2\Requests\Login;

$factory = new AuthenticationFactory();
$service = $factory->createService();

$url = $service->getLogoutUrl(
    new Logout(
        'https://hetmantest.epuap.gov.pl/DracoEngine2/draco.jsf',
        'your.username',
        '/your.application.id'
    )
);

header('Location: ' . $url);
exit();
bash
# Install Composer
curl -sS https://getcomposer.org/installer | php