l3/uid-user-bundle

CAS 用户提供者(仅返回 UID)

安装次数: 887

依赖者: 0

建议者: 0

安全性: 0

星标: 0

关注者: 2

分支: 2

开放问题: 0

类型:symfony-bundle

1.0.13 2023-12-22 19:15 UTC

This package is auto-updated.

Last update: 2024-09-22 21:08:36 UTC


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 键的值