jtangas / auth-bundle
利用 FOSUserBundle、JWT 以及 JWT 基础 REST 环境所需的工具的 symfony 授权组件
0.6
2017-12-21 00:37 UTC
Requires
README
使用 composer 安装此包
composer require jtangas/auth-bundle
将 LexikJWT、FOSUserBundle 和此组件添加到 app/AppKernel.php
$bundles = [
...
new Lexik\Bundle\JWTAuthenticationBundle\LexikJWTAuthenticationBundle(),
new Jtangas\AuthBundle\JtangasAuthBundle(),
new FOS\UserBundle\FOSUserBundle(),
];
按照提示生成 Lexik JWT 的默认值
值
| 参数 | 默认值 | 描述 |
|---|---|---|
| jwt_private_key_path | '%kernel.project_dir%/var/jwt/private.pem' | 包将构建 JWT 私有 pem 文件的默认位置。 |
| jwt_public_key_path | '%kernel.prject_dir%/var/jwt/public.pem' | 包将构建 JWT 公共 pem 文件的默认位置。 |
| jwt_key_pass_phrase | null | 用户必须提供的密码以保护私有密钥文件 |
| jwt_token_ttl | null | 已弃用 |
| jwt_token_ttl_admin | null | 为具有 FOS User Roles 的管理员用户设置令牌 TTL |
| jwt_token_ttl_user | null | 为具有 FOS User Roles 的普通用户设置令牌 TTL |
| user_identity_field | username | 定义在数据库中将用作用户登录名的字段 |
| user_class | null | 定义将实现 FOS User 类的用户类 |
| extra_debug | false | 已弃用 |