nella/simple-hash-authenticator

此包已被弃用且不再维护。未建议替代包。

Nette 框架的简单哈希验证器

v1.0.1 2014-10-05 13:54 UTC

This package is auto-updated.

Last update: 2020-12-06 16:06:44 UTC


README

Build Status SensioLabsInsight Status Latest Stable Version Composer Downloads Dependency Status HHVM Status

安装

composer require nella/simple-hash-authenticator

使用

$authenticator = new \Nella\SimpleHashAuthenticator\Authenticator(array(
    'demo' => '$2y$10$l5cjVRLvK2mjm6hzj8.s8.yjXmtO0Eio0JNt.JwAbZccndN9m1IVi', // hash of 'test'
), array(
    'demo' => array(
        'admin'
    ),
));

/** @var \Nette\Security\User $user */
$user->setAuthenticator($authenticator);

或注册扩展

extensions:
    authenticator: Nella\SimpleHashAuthenticator\Extension

authenticator:
    users:
        demo:
            password: '$2y$10$l5cjVRLvK2mjm6hzj8.s8.yjXmtO0Eio0JNt.JwAbZccndN9m1IVi'
            roles:
                - admin

# or without roles

authenticator:
    users:
        demo: '$2y$10$l5cjVRLvK2mjm6hzj8.s8.yjXmtO0Eio0JNt.JwAbZccndN9m1IVi'

用于哈希生成器

authenticator:
    router: @router # or your router service name

并访问 http://yourweb.local/authenticator

许可

Nette 框架的简单哈希验证器采用 MIT 许可证 - 详细信息请参阅 LICENSE 文件