intracto / fas-open-id-bundle
使用Fas Open Id进行身份验证的简单包
1.1.4
2022-10-25 12:53 UTC
Requires
- php: ^7.1 || ^8.0
- ext-json: *
- doctrine/doctrine-bundle: ^1.12.13 || ^2.0
- phpseclib/phpseclib: ^2.0
- symfony/framework-bundle: ^5.4
- symfony/http-client: ^5.4
- symfony/monolog-bundle: ^3.3
- symfony/security-bundle: ^5.4
Requires (Dev)
- symfony/phpunit-bridge: ^4.3
- dev-master
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.9
- 1.0.8
- 1.0.7
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- dev-symfony5
- dev-dependabot/composer/doctrine/doctrine-bundle-tw-2.4
- dev-dependabot/composer/symfony/phpunit-bridge-tw-5.3
- dev-dependabot/add-v2-config-file
- dev-dependabot/composer/phpseclib/phpseclib-tw-3.0
- dev-meta
This package is auto-updated.
Last update: 2024-09-25 17:10:55 UTC
README
使用此包,您的应用用户可以使用联邦身份验证服务(FAS)通过OpenId登录到应用。
安装
使用Symfony Flex的应用
打开命令行,进入您的项目目录,并执行以下命令
$ composer require intracto/fas-open-id-bundle
不使用Symfony Flex的应用
步骤 1: 下载包
打开命令行,进入您的项目目录,并执行以下命令以下载此包的最新稳定版本
$ composer require intracto/fas-open-id-bundle
此命令需要您已全局安装Composer,如Composer文档中的安装章节中所述。
步骤 2: 启用包
然后,通过将其添加到项目config/bundles.php文件中注册的包列表来启用此包
// config/bundles.php return [ // ... Intracto\FasOpenIdBundle\IntractoFasOpenIdBundle::class => ['all' => true], ];
步骤 3: 注册包路由
在您的应用中加载包的路由
intracto_fas_open_id: resource: "@IntractoFasOpenIdBundle/Resources/config/routing.xml"
步骤 4: 配置
包配置
(如果未通过Flex执行,请在您的config/packages文件夹中创建一个intracto_fas_open_id.yaml文件)。
运行此包所需配置参数
client_id
: 您注册应用的客户端IDclient_secret
: 您注册应用的客户端密钥scope
: 此应用将使用的范围列表。可能的值包括profile、egovnrn、certificateInfo、citizen、enterprise和roles。openid角色将自动使用auth_path
:FasOpenIdAuthenticator
将检查以进行用户验证的路由名称。此参数的默认值为intracto_fas_open_id.auth
target_path
: 用户成功验证后将重定向到的路由名称login_path
: 用户需要登录时将重定向到的路由名称user_class
: 您的用户类的全称,这是可选的。请确保您的用户扩展了此包的用户类
防火墙配置
然后,您需要告诉应用防火墙(s)应使用哪个认证器。在防火墙(s)的guard参数下,您需要在认证器参数中追加intracto.fas_open_id.authenticator
security: providers: intracto_fas_open_id_user_provider: id: intracto.fas_open_id.user_provider ... my_firewall: ... guard: ... authenticators: - intracto.fas_open_id.authenticator provider: intracto_fas_open_id_user_provider
如果您想从FAS注销,请将intracto.fas_open_id.logout_handler
添加到您的防火墙注销处理器中。