fof/oauth 问题修复 & 功能扩展

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

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

fof/oauth

最新稳定版本:2.0.0-beta.1

Composer 安装命令:

composer require fof/oauth

包简介

Allow users to log in with GitHub, Twitter, Facebook, Google, and more!

README 文档

README

License Latest Stable Version Total Downloads OpenCollective

A Flarum extension. Allow users to log in with various OAuth providers

Bundled providers

By default these providers are included:

  • Discord
  • Facebook
  • Github
  • Gitlab
  • Google
  • LinkedIn
  • Twitter

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:

  1. Go to the extension settings
  2. Enable the desired OAuth provider
  3. Click the settings icon for that provider
  4. Select a group from the "Assign Group" dropdown
  5. 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, let us know if you know of any more and we'll get them added!

Screenshots

Default provider settings example provider setup example

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

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>_button to replace the entire button "Log In with " text

Extending

It is possible to add additional Providers using an extender. See OAuth-Amazon for an example of how to accomplish this but basically:

  • In your new extension, require fof/oauth as a dependency
  • Define a new Provider which extends FoF\OAuth\Provider
  • From your new extensions extend.php, register the provider (new FoF\OAuth\Extend\RegisterProvider(MyNewProvider::class))
  • Provide the required translations under the fof-oauth namespace. See the linked example extension for details on which keys are required.
  • (optionally) Provide an admin panel link to fof/oauth for easy configuration. Again, see the linked example.
  • (optionally) Provide any CSS required to style your new login button. See the linked example.

Links

OpenCollective

An extension by FriendsOfFlarum.

统计信息

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

GitHub 信息

  • Stars: 47
  • Watchers: 6
  • Forks: 19
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-09-19