stethome/ory-auth-bundle
Composer 安装命令:
composer require stethome/ory-auth-bundle
包简介
Symfony Authenticator for Ory Kratos
README 文档
README
This bundle provides Symfony Authenticator for Ory Kratos
Installation
composer require stethome/ory-auth-bundle
If your project does not use Symfony Flex you need to manually register the bundle in config/bundles.php:
<?php return [ // your other bundles above StethoMe\OryAuthBundle\StethoMeOryAuthBundle::class => ['all' => true], ];
Configuration
To authenticate your users with Ory Kratos you need to enable ory_kratos authenticator on your firewall and create a user provider.
Firewall
Minimal configuration
security: providers: my_user_provider: { id: App\Security\Service\User\UserProvider } firewalls: main: provider: my_user_provider ory_kratos: public_url: https://account.mycompany.com
Full configuration example
security: providers: my_user_provider: { id: App\Security\Service\User\UserProvider } my_other_user_provider: { id: App\Security\Service\User\OtherUserProvider } firewalls: main: provider: my_user_provider ory_kratos: # The URL where Ory Kratos's Public API is located at. # If this app and Ory Kratos are running in the same private network, this should be the private network address (e.g. kratos-public.svc.cluster.local) public_url: kratos-public.svc.cluster.local # The browser accessible URL where Ory Kratos's public API is located, only needed if it differs from public_url browser_url: https://account.mycompany.com # Name of the cookie holding Ory Kratos session session_cookie: ory_kratos_session # User provider used by OryKratosAuthenticator, defaults to firewall user provider provider: my_other_user_provider # Base authenticator service, the firewall authenticator will be child of this service authenticator: ~
User Provider
class UserProvider implements UserProviderInterface { /** * @param AppUser $user */ public function refreshUser(UserInterface $user): AppUser { return $user; // noop } public function loadUserByIdentifier(string $identifier): AppUser { // identifier is Ory Kratos Identity UUID return new AppUser($identifier); } public function supportsClass(string $class): bool { return $class === AppUser::class; } } class AppUser implements UserInterface { private string $uuid; public function __construct(string $identity) { $this->uuid = $identity; } // UserInterface methods };
License
This bundle is under the MIT license.
For the whole copyright, see the LICENSE file distributed with this source code.
stethome/ory-auth-bundle 适用场景与选型建议
stethome/ory-auth-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 989 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 09 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「symfony」 「Authentication」 「bundle」 「ory」 「kratos」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 stethome/ory-auth-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 stethome/ory-auth-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 stethome/ory-auth-bundle 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Automatically logs-in users if they are already authenticated by a remote source. (e.g. environment variable REMOTE_USER)
2lenet/EasyAdminPlusBundle
GraphQL authentication for your headless Craft CMS applications.
The bundle for easy using json-rpc api on your project
Provide a way to secure accesses to all routes of an symfony application.
DMS Meetup API Bundle, enables Meetup API clients in services
统计信息
- 总下载量: 989
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 20
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-09-06