fof/oauth
Composer 安装命令:
composer require fof/oauth
包简介
Allow users to log in with GitHub, Facebook, Google, Discord, GitLab, LinkedIn, and more!
README 文档
README
A Flarum extension. Allow users to log in and register using OAuth 2.0 providers. Supports account linking, automatic email-match linking, and a security-settings page where users can manage their connected providers.
Bundled providers
By default these providers are included:
- Discord
- GitHub
- GitLab
Features
- Login & registration via any enabled OAuth 2.0 provider
- Account linking — authenticated users can connect a provider from their security settings page
- Email-match auto-link — if a provider returns an email address that matches an existing account, the provider is linked automatically and the user is logged in
- Account linked confirmation — a modal is shown the first time a provider is linked, confirming the connection
- PKCE support — providers that support Proof Key for Code Exchange can opt in per-provider
- Group assignment — automatically assign users to a forum group when they register via a specific provider
- Admin moderation — view and manage users' linked provider accounts from the admin panel
Permissions
This extension provides the ability to view the status of linked OAuth providers (intended for admin and/or moderator use). In order for this to function correctly, you must also set the permission Moderate Access Tokens to at least the same group as you require for Moderate user's linked accounts.
Group Assignment
You can configure each OAuth provider to automatically assign users to a specific group when they register. This is useful for tracking which provider users signed up with or for granting specific permissions based on the authentication method.
To configure group assignment:
- Go to the extension settings
- Enable the desired OAuth provider
- Click the settings icon for that provider
- Select a group from the "Assign Group" dropdown
- Save your changes
Users who register through that provider will automatically be assigned to the selected group.
Additional providers
Additional OAuth providers are available for this extension. Here's a handy list of known extensions:
If you know of others, please open a PR to add them to this list.
Screenshots
Default provider settings example

Login/signup example with Github, Twitter, Twitch and Google enabled.

Installation
composer require fof/oauth
Updating
composer update fof/oauth php flarum cache:clear
Configuration
Translation
You can replace the text for the forum sign in buttons in two ways:
- Use
fof-oauth.forum.providers.<name>to replace the name of the provider on the forum side - Use
fof-oauth.forum.log_in.with_<name>_buttonto replace the entire button "Log In with <name>" text
Extending
It is possible to add additional providers using an extender. See UPGRADE.md for a full guide, including a complete example provider class and notes on breaking changes between versions.
In short:
- In your new extension, require
fof/oauthas a dependency - Define a new
Providerclass which extendsFoF\OAuth\Provider - From your new extension's
extend.php, register the provider:(new FoF\OAuth\Extend\RegisterProvider(MyNewProvider::class)) - Provide the required translations under the
fof-oauthnamespace (see UPGRADE.md for required keys)
Upgrading an existing provider extension to Flarum 2.x? See UPGRADE.md for the full list of breaking changes.
Links
An extension by FriendsOfFlarum.
fof/oauth 适用场景与选型建议
fof/oauth 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 134.12k 次下载、GitHub Stars 达 50, 最近一次更新时间为 2020 年 09 月 19 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「oauth」 「github」 「google」 「facebook」 「linkedin」 「gitlab」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 fof/oauth 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 fof/oauth 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 fof/oauth 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Handles basic OAuth/OAuth2 authentication along with classes for common services
WeChat OAuth SDK
Ory-Hydra OAuth 2.0 Client Provider for The PHP League OAuth2-Client
Library for ORCID web services
A lightweight and powerful OAuth 2.0 authorization and resource server library with support for all the core specification grants. This library will allow you to secure your API with OAuth and allow your applications users to approve apps that want to access their data from your API.
MediaWiki extension that allows embedding external content, specified by URL, into your wiki pages
统计信息
- 总下载量: 134.12k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 51
- 点击次数: 38
- 依赖项目数: 45
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-09-19