phramework 的 JWT 认证包装器,使用 firebase/php-jwt

1.0.2 2017-12-12 09:38 UTC

This package is auto-updated.

Last update: 2024-08-28 23:12:40 UTC


README

JWT 授权包装器用于 phramework,使用 firebase/php-jwt

Build Status

用法

要求包

composer require phramework/jwt
//Set authentication class
\Phramework\Authentication\Manager::register(
    \Phramework\Authentication\JWT\JWT::class
);

//Set method to fetch user object, including password attribute
\Phramework\Authentication\Manager::setUserGetByEmailMethod(
    [\MyApp\API\Models\User::class, 'getByEmailWithPassword']
);

\Phramework\Authentication\Manager::setAttributes(
    ['user_type', 'email']
);

安装依赖项

composer update

测试和代码检查

composer lint
composer test

许可证

版权所有 2015 Xenofon Spafaridis

根据 Apache 许可证 2.0 版(“许可证”)许可;除非适用法律要求或已书面同意,否则不得使用此文件,除非完全遵守许可证。您可以在以下位置获取许可证副本:

https://apache.ac.cn/licenses/LICENSE-2.0

除非适用法律要求或已书面同意,否则在许可证下分发的软件按“原样”提供,不提供任何明示或暗示的保证或条件。有关许可证的具体语言、权限和限制,请参阅许可证。