bitweb/id-card

BitWeb 扩展用于爱沙尼亚身份证认证和签名。

2.0.1 2014-04-29 14:25 UTC

This package is auto-updated.

Last update: 2024-09-21 19:58:04 UTC


README

Build Status Coverage Status

BitWeb 身份证认证和签名插件。

用法

添加库

php composer.phar require bitweb/id-card
# (When asked for a version, type `2.0.*`)

或者将以下内容添加到 composer.json 中

"require": {
  "bitweb/id-card": "2.0.*"
}

与 Apache 集成

将 id-card 文件夹添加到您的公共文件夹
该文件夹应包含 index.php,内容如下
use BitWeb\IdCard\Authentication\IdCardAuthentication;

chdir(dirname(dirname(__DIR__)));

// Autoload classes
include 'vendor/autoload.php';
include 'init_autoloader.php';
Zend\Mvc\Application::init(require 'config/application.config.php');

$redirectUrl = urldecode($_GET["redirectUrl"]);

if (!IdCardAuthentication::isSuccessful()) {
    $redirectUrl = '/id-card/no-card-found';
} else {
    IdCardAuthentication::login();
}
$headerStr = 'Location: ' . $redirectUrl;

header($headerStr);
同一文件夹中应存在 .htaccess 文件
SSLVerifyClient require
SSLVerifyDepth 3
现在您的应用程序中的链接应指向具有查询参数 redirectUrl 的此 index.php

将身份证支持添加到开发环境

http://www.id.ee/public/Configuring_Apache_web_server_to_support_ID.pdf

祝您使用愉快