jtangas/auth-bundle

利用 FOSUserBundle、JWT 以及 JWT 基础 REST 环境所需的工具的 symfony 授权组件

0.6 2017-12-21 00:37 UTC

This package is auto-updated.

Last update: 2024-09-23 10:26:46 UTC


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_phrasenull用户必须提供的密码以保护私有密钥文件
jwt_token_ttlnull已弃用
jwt_token_ttl_adminnull为具有 FOS User Roles 的管理员用户设置令牌 TTL
jwt_token_ttl_usernull为具有 FOS User Roles 的普通用户设置令牌 TTL
user_identity_fieldusername定义在数据库中将用作用户登录名的字段
user_classnull定义将实现 FOS User 类的用户类
extra_debugfalse已弃用