forci/login-bundle 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

forci/login-bundle

Composer 安装命令:

composer require forci/login-bundle

包简介

A Symfony ~3.0 Bundle that eases logging users to your Symfony application.

README 文档

README

A Symfony ~3.0|~4.0 Bundle that eases logging users to your Symfony application.

Configuration Sample

forci_login:
    managers:
        frontend:
            firewall_name: frontend_area # Your firewall name
            hwi_oauth: # HWIOAuthBundle integration - for use directly with OAuth Access Tokens
                enabled: true
                token_class: Forci\Bundle\LoginBundle\HWIOAuth\OAuthToken # You may change the token class to this
                # Or to your own class that extends the Bundle's token class. Using the above example 
                # In combination with the below setting will force the Token to return true to isAuthenticated calls
                # This resolves HWIOAuthBundle's issues with serialization and/or your users not having any roles by default
                # Which mostly leads to making HTTP requests to the OAuth APIs on E V E R Y page load.
                # PS You may also use that class, or your own implementation of this idea and a custom 
                # \HWI\Bundle\OAuthBundle\Security\Core\Authentication\Provider\OAuthProvider to prevent that
                # In the case of a normal web-redirect login flow with the bundle
                always_authenticated: true
                user_provider: app.auth.user_provider
<?php 
/** @var \Symfony\Component\DependencyInjection\ContainerInterface */
$container;
/** @var \Forci\Bundle\LoginBundle\Helper\LoginHelper $manager */
$manager = $container->get('forci_login.helper.frontend'); // where frontend is your config key
$manager->logInUser($user);
$manager->rememberUser($user, $response);
$manager->logInHWIOAuthAccessToken($accessToken, $state, $resourceOwner);
$manager->rememberHWIOAuthAccessToken($accessToken, $state, $resourceOwner, $response);
<?php
/** @var \Symfony\Component\DependencyInjection\ContainerInterface */
$container;
$manager = $container->get('forci_login.helper.silent');
// $user is your User object
// some_area_key is your firewall key
// some_area_context is your security context config for your firewall
// Sample config down below, just for example purposes
$manager->loginSilent($user, 'some_area_key', 'some_area_context');
security:
    firewalls:
        some_area_key:
            pattern: ^/some/path
            context: some_area_context

TODOs

  • Possibly extend UsernamePasswordToken and make it configurable, again with the option to always be considered authenticated?

  • Have a good look at those services from Symfony Security and consider implementing calls to those as otherwise redirect target path will not be correctly cleared upon success?

  • Have a look at PreAuthenticatedToken ?g

forci/login-bundle 适用场景与选型建议

forci/login-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 9.62k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2018 年 01 月 22 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「wucdbm」 「login manager」 「login bundle」 「hwi oauth token login integration」 「oauth login bundle」 「forci」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 forci/login-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 forci/login-bundle 我们能提供哪些服务?
定制开发 / 二次开发

基于 forci/login-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 9.62k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-01-22