feeria/php-frejaeid
Composer 安装命令:
composer require feeria/php-frejaeid
包简介
Freja eID API PHP integration package. Original development by DSorlov/phpFreja.
关键字:
README 文档
README
Simple PHP wrapper to get information from Freja eID REST API for use both in test and production enviroment.
- Supports validation of the JWS but requires external library for that part (thanks to php-jws).
- Supports both directed and inferred authentication, for use with qr-code and app.
- Supports authentication and signature api but not the assertion service.
- Supports specific data fetching within array Available data
- Well behaved functions that do not throw (atleast not by design) but always return objects for simpler handling.
To setup your test enviroment and then basic agreement read this information on Freja eID website.
Installation
To run installation type following in your project command line:
composer require feeria/php-frejaeid
Quickstart
use Feeria\PhpFrejaeid\PhpFrejaeid; // Create FrejaeID API Instance $frejaApi = new PhpFrejaeid( 'path_to_your_pfx_certificate.pfx', 'your_password', false, // production mode ); // Initialize the authorization $authResponse = $frejaApi->initAuthentication( 'EMAIL', 'FREJAEID_USER_EMAIL', 'BASIC', // auth level, can be BASIC, EXTENDED, PLUS [ 'EMAIL_ADDRESS', // and any another from official docs ] ); // Return user data if ($authResponse->success) $authStatus = $frejaApi->checkAuthentication($authResponse->authRef); return $authStatus; // all user data from FrejaeID
Create URL for QR-Code
$qrInfo = $frejaAPI->createAuthQRCode(); if ($qrInfo->success) $imageUrl = $qrInfo->url;
Init, monitor and cancel authentication request
$authResponse = $frejaAPI->initAuthentication('EMAIL','youremail@yourserver.com'); if ($authResponse->success) $authStatus = $frejaAPI->checkAuthRequest($authResponse->authRef); $frejaAPI->cancelAuthentication($authResponse->authRef);
Init, monitor and cancel signature request
$signResponse = $frejaAPI->initSignatureRequest('EMAIL','youremail@yourserver.com','Testsign','This is the agreement text'); if ($signResponse->success) $signStatus = $frejaAPI->checkSignatureRequest($signResponse->signRef); $frejaAPI->cancelSignatureRequest($authResponse->signRef);
统计信息
- 总下载量: 21
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-08-14