vbridgecloud/c-all-app-login-bundle
Composer 安装命令:
composer require vbridgecloud/c-all-app-login-bundle
包简介
Symfony Bundle to connect C-all applications
README 文档
README
Use this bundle to authenticate a user in a Symfony application through C-all's login app.
Installation
Require the bundle with composer
composer require vbridgecloud/c-all-app-login-bundle
Add it to your Symfony app bundles.php
# config/bundles.php <?php return [ // ... vBridgeCloud\CallLoginBundle\CallLoginBundle::class => ['all' => true], ];
Configure it
# config/packages/vbridgecloud_calllogin.yaml call_login: public_url: '%env(LOGIN_PUBLIC_URL)%' # The public URL the login app is available through internal_url: '%env(LOGIN_INTERNAL_URL)%' # Internal DNS url for the login app client_id: '%env(LOGIN_CLIENT_ID)%' # Client ID to be used to authenticate client_secret: '%env(LOGIN_CLIENT_SECRET)%' # Client secret
Configure your security:
# config/packages/security.yaml security: providers: user_provider: id: call_login.user_provider firewalls: # ... main: custom_authenticators: - call_login.authenticator entry_point: call_login.entrypoint # ... access_control: - { path: ^/login/authorize, roles: IS_AUTHENTICATED_ANONYMOUSLY }
Whatever authorize endpoint you end up using (see below), it must be
Authorization endpoint
This bundle needs an endpoint to be redirected back to, either use the provided controller and route :
# config/routes.yaml call_login: resource: '@CallLoginBundle/Resources/config/routing.yaml'
Or add your own route in a controller somewhere and configure it:
# config/packages/vbridgecloud_calllogin.yaml call_login: oauth_redirect_path: 'my_authorize_route'
Optional configuration
By default, after login, your app will be redirected to the home route. Make sure you either have a named route home or override it through configuration with the login_redirect_path config option.
统计信息
- 总下载量: 427
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-02-24