lenius/laravel-altid
Composer 安装命令:
composer require lenius/laravel-altid
包简介
AltID age verification (OID4VP/mdoc) integration for Laravel
README 文档
README
A Laravel package for integrating with AltID — Danmarks officielle app til digitalt ID og aldersverifikation.
AltID is a digital identity wallet built on the eIDAS2 regulation, enabling citizens to securely share verified credentials. This package implements the OID4VP (OpenID for Verifiable Presentations) flow with mdoc/ISO 18013-5 credentials to receive age verification responses from the AltID app.
Note: This package currently only supports age verification. Support for full digital ID (identification) is planned for a future release.
Requirements
- PHP 8.4+
- Laravel 11, 12 or 13
- A cache driver (Redis recommended for production)
Installation
composer require lenius/laravel-altid
Publish the config file:
php artisan vendor:publish --tag="laravel-altid-config"
Optionally publish views and assets:
php artisan vendor:publish --tag="laravel-altid-views" php artisan vendor:publish --tag="laravel-altid-assets"
Configuration
Key environment variables:
# The age claim to verify (default: age_over_18) ALTID_AGE_CLAIM=age_over_18 # Transaction TTL in minutes (default: 15) ALTID_TRANSACTION_TTL_MINUTES=15 # AltID deep-link scheme (default: av://) ALTID_SCHEME=av:// # mdoc doctype ALTID_DOCTYPE=eu.europa.ec.av.1 ALTID_NAMESPACE=eu.europa.ec.av.1 # Trust anchor certificate fingerprint(s), comma-separated ALTID_TRUST_ANCHOR_FINGERPRINTS=1dc89e870cddac990f5585a0265568522531af678592cc73effd9f8706f55995 # Set true only during development to skip cryptographic verification ALTID_ACCEPT_UNVERIFIED_RESPONSES=false # Require device binding in the mdoc proof ALTID_REQUIRE_DEVICE_BINDING=false # Disable built-in web demo/info routes (/altid, /alderstjek) ALTID_REGISTER_WEB_ROUTES=true
Supported age claims:
| Claim | Description |
|---|---|
age_over_13 |
13+ |
age_over_15 |
15+ |
age_over_16 |
16+ |
age_over_18 |
18+ (default) |
age_over_21 |
21+ |
age_over_23 |
23+ |
age_over_25 |
25+ |
age_over_27 |
27+ |
age_over_67 |
67+ |
Routes
The package registers the following routes automatically:
API routes (/api)
| Method | URI | Description |
|---|---|---|
POST |
/api/altid/age/start |
Start an age verification transaction |
POST |
/api/altid/age/direct-post/{transactionId} |
OID4VP callback from the AltID app |
GET |
/api/altid/age/{transactionId}/status |
Poll transaction status |
Web routes
| URI | Description |
|---|---|
/altid |
Info page |
/alderstjek |
Demo page |
Usage
Start an age verification
use Lenius\LaravelAltid\AltIdAgeVerificationService; $service = app(AltIdAgeVerificationService::class); // Start with default claim (age_over_18) $transaction = $service->start(); // Or specify a claim $transaction = $service->start('age_over_21');
The returned array contains:
[
'transaction_id' => 'abc123',
'authorization_url' => 'av://?response_type=vp_token&...', // deep-link for AltID app
'test_app_url' => 'https://app.test.tegnebog.dk/...', // for testing
'status_url' => 'https://yourapp.com/api/altid/age/abc123/status',
// ...
]
Present the authorization_url as a QR code or deep-link button so the user can open it in the AltID app.
Poll for result
$transaction = $service->find($transactionId); // $transaction['status'] => 'pending' | 'approved' | 'failed' // $transaction['verified'] => true | false
Testing
Request test access by emailing AltID@digst.dk with subject line Testadgang til AltID.
The test tool is available at test-tool.test.tegnebog.dk.
Set ALTID_ACCEPT_UNVERIFIED_RESPONSES=true in your .env during development to bypass cryptographic verification.
composer test
AltID Resources
| Resource | URL |
|---|---|
| Official AltID page | digitaliser.dk/altid |
| Digitaliseringsstyrelsen | digst.dk/it-loesninger/altid |
| Technical integration guide (PDF) | Integrating with AltID v1.0.1 |
| Recipient design scheme (Figma) | figma.com/design/O99M3b5pEf0mTn1xRY9pGo |
| Recipient registry | modtager.tegnebog.dk |
| Source code (GitLab) | git.govcloud.dk/digitaliseringsstyrelsen-public/altid-source-code |
| Technical support | AltID@digst.dk |
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
lenius/laravel-altid 适用场景与选型建议
lenius/laravel-altid 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 06 月 09 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「mdoc」 「lenius」 「OID4VP」 「age-verification」 「laravel-altid」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 lenius/laravel-altid 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 lenius/laravel-altid 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 lenius/laravel-altid 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Shopping basket package for laravel 10 & 11
Shopping basket package for Laravel
Alfabank REST API integration
Wrapper for documo api
Wrapper for documo api
Laravel package for Accurate Online API integration.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 35
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-06-09