承接 lenius/laravel-altid 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

lenius/laravel-altid

最新稳定版本:v0.0.1

Composer 安装命令:

composer require lenius/laravel-altid

包简介

AltID age verification (OID4VP/mdoc) integration for Laravel

README 文档

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status codecov Total Downloads

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.

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-06-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固