mrvanes / simplesamlphp-module-authwebauthn
Webauthn认证处理模块。
dev-master
2019-10-02 08:37 UTC
Requires
This package is auto-updated.
Last update: 2024-08-29 05:06:41 UTC
README
本模块实现了一个simpleSAMLphp authproc,可用于使用Webauthn兼容的安全设备强制执行二次因素认证。
感谢David Earl在基于PHP的Webauthn实现方面做出的卓越开端!
需求
此模块使用php-sqlite3数据库来存储用户/密钥组合。
安装
composer require mrvanes/simplesamlphp-module-authwebauthn:dev-master
用法
authproc可以配置为注册或验证进程。在任何authsource上启用进程。例如,一个用于注册目的,一个用于验证目的。
'sp-register' => [
'saml:SP',
'entityID' => null,
'idp' => 'idp-register',
'discoURL' => null,
'authproc' => [
// Add Webauthn second factor registration
100 => ['class' => 'authwebauthn:WebAuthn',
'id' => 'uid',
'database' => '/var/tmp/keys.sq3',
'purpose' => 'register'
],
],
],
'sp-login' => [
'saml:SP',
'entityID' => null,
'idp' => 'idp-login',
'discoURL' => null,
'authproc' => [
// Add Webauthn second factor validation
100 => ['class' => 'authwebauthn:WebAuthn',
'id' => 'uid',
'database' => '/var/tmp/keys.sq3',
'purpose' => 'validate'
],
],
],
或者在托管IdP上使用回退场景(如果无法验证则注册,即首次使用即信任)。
$metadata['__DYNAMIC:1__'] = [
'host' => '__DEFAULT__',
'privatekey' => 'server.pem',
'certificate' => 'server.crt',
'auth' => 'example-userpass',
'attributes.NameFormat' => 'urn:oasis:names:tc:SAML:2.0:attrname-format:uri',
'authproc' => [
// Add Webauthn second factor validation
100 => ['class' => 'authwebauthn:WebAuthn',
'id' => 'uid',
'database' => '/var/tmp/keys.sq3',
'purpose' => 'fallback'
],
],
],
];