l3 / uid-user-bundle
CAS 用户提供者(仅返回 UID)
1.0.13
2023-12-22 19:15 UTC
Requires
- php: >=8.2
- symfony/framework-bundle: ~7.0
- symfony/http-foundation: ~7.0
- symfony/routing: ~7.0
- symfony/security-bundle: ~7.0
README
CAS 用户提供者
允许只使用 UID(由 CasBundle 返回)来应用于 Symfony2、Symfony3、Symfony4、Symfony 5 和 Symfony 6(uid 是 jasig cas sso 服务器和 l3-team/CasBundle(GitHub 存储库)或 l3/cas-bundle(Packagist 存储库)返回的用户 ID)
Bundle 安装
使用以下命令安装 Bundle:
composer require l3/uid-user-bundle:~1.0
运行命令 composer update 来安装包。
对于 Symfony 2 和 3:在 AppKernel.php 文件中添加 Bundle。
<?php
// app/AppKernel.php
// ...
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
// ...
new L3\Bundle\UidUserBundle\L3UidUserBundle(),
);
// ...
}
// ...
}
对于 Symfony 4、Symfony 5 和 Symfony 6:检查 config/bundles.php 文件中是否存在这些行(如果不存在,只需添加这些行)
# config/bundles.php
...
L3\Bundle\UidUserBundle\L3UidUserBundle::class => ['all' => true],
...
Bundle 配置
对于 Symfony 2 和 3:在您的应用程序的防火墙中,使用 Bundle
# app/config/security.yml
security:
providers:
uid:
id: uid_user_provider
对于 Symfony 4、Symfony 5 和 Symfony 6:在您的应用程序的防火墙中,使用 Bundle
# config/packages/security.yaml
security:
providers:
uid:
id: uid_user_provider
对于 Symfony 6
# config/packages/security.yaml
security:
providers:
uid_user_provider:
id: uid_user_provider
并指定 uid_user_provider 作为 security.yaml 文件中防火墙的 provider 键的值