PHPackages                             fof/oauth - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. fof/oauth

ActiveFlarum-extension[Authentication &amp; Authorization](/categories/authentication)

fof/oauth
=========

Allow users to log in with GitHub, Facebook, Google, Discord, GitLab, LinkedIn, and more!

1.7.3(6mo ago)51135.5k↓21.1%21[6 issues](https://github.com/FriendsOfFlarum/oauth/issues)[6 PRs](https://github.com/FriendsOfFlarum/oauth/pulls)20MITPHPPHP ^7.4 || ^8.0CI passing

Since Oct 9Pushed 2mo ago5 watchersCompare

[ Source](https://github.com/FriendsOfFlarum/oauth)[ Packagist](https://packagist.org/packages/fof/oauth)[ Docs](https://friendsofflarum.org)[ Fund](https://opencollective.com/fof/donate)[ RSS](/packages/fof-oauth/feed)WikiDiscussions 2.x Synced today

READMEChangelog (10)Dependencies (10)Versions (60)Used By (20)

OAuth by FriendsOfFlarum
========================

[](#oauth-by-friendsofflarum)

[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667) [![Latest Stable Version](https://camo.githubusercontent.com/c3457b8129ba2807d11de27cf2ab785e75adb1ac3c2335b5138a6eb1fc236c47/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f666f662f6f617574682e737667)](https://packagist.org/packages/fof/oauth) [![Total Downloads](https://camo.githubusercontent.com/07878f997c47037f922b91027b3018a1f9d1b7c5abd64c5151aa8b850652047a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f666f662f6f617574682e737667)](https://packagist.org/packages/fof/oauth) [![OpenCollective](https://camo.githubusercontent.com/1903c197bb0307e60d6328653532b8a6b9890b898fbc92e314ab39d699491e74/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6f70656e636f6c6c6563746976652d666f662d626c75652e737667)](https://opencollective.com/fof/donate)

A [Flarum](http://flarum.org) 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

[](#bundled-providers)

By default these providers are included:

- Discord
- Facebook
- GitHub
- GitLab
- Google
- LinkedIn

### Features

[](#features)

- **Login &amp; 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

[](#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

[](#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-providers)

Additional OAuth providers are available for this extension. Here's a handy list of known extensions:

- [Amazon](https://discuss.flarum.org/d/29191-login-with-amazon)
- [Apple](https://discuss.flarum.org/d/31938-blomstra-sign-in-with-apple)
- [Auth0](https://extiverse.com/extension/lodge104/flarum-ext-oauth-auth0)
- [Line](https://discuss.flarum.org/d/31860-sign-in-with-line)
- [Microsoft](https://flarum.org/extension/xrh0905/oauth-microsoft)
- [Slack](https://discuss.flarum.org/d/31039-blomstra-sign-in-with-slack)
- [Twitch](https://github.com/imorland/flarum-ext-oauth-twitch)

If you know of others, please open a PR to add them to this list.

### Screenshots

[](#screenshots)

Default provider settings example [![provider setup example](https://user-images.githubusercontent.com/16573496/201470744-ca8be058-f79c-4fc4-8c19-3ac5af2bd44b.png)](https://user-images.githubusercontent.com/16573496/201470744-ca8be058-f79c-4fc4-8c19-3ac5af2bd44b.png)

Login/signup example with `Github`, `Twitter`, `Twitch` and `Google` enabled. [![example login](https://user-images.githubusercontent.com/16573496/201470704-91874f67-284a-4fb2-967c-fd9d0eff2d9f.png)](https://user-images.githubusercontent.com/16573496/201470704-91874f67-284a-4fb2-967c-fd9d0eff2d9f.png)

### Installation

[](#installation)

```
composer require fof/oauth
```

### Updating

[](#updating)

```
composer update fof/oauth
php flarum cache:clear
```

### Configuration

[](#configuration)

#### Translation

[](#translation)

You can replace the text for the forum sign in buttons in two ways:

- Use `fof-oauth.forum.providers.` to replace the name of the provider on the forum side
- Use `fof-oauth.forum.log_in.with__button` to replace the entire button "Log In with &lt;name&gt;" text

### Extending

[](#extending)

It is possible to add additional providers using an extender. See [UPGRADE.md](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/oauth` as a dependency
- Define a new `Provider` class which extends `FoF\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-oauth` namespace (see [UPGRADE.md](UPGRADE.md) for required keys)

> **Upgrading an existing provider extension to Flarum 2.x?** See [UPGRADE.md](UPGRADE.md) for the full list of breaking changes.

### Links

[](#links)

[![OpenCollective](https://camo.githubusercontent.com/8ea53c451470d1a72789d650c77e2b22eee915f7fbf2cbeeeeaa25f47301efe2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646f6e6174652d667269656e64736f66666c6172756d2d3434414545353f7374796c653d666f722d7468652d6261646765266c6f676f3d6f70656e2d636f6c6c656374697665)](https://opencollective.com/fof/donate)

- [Discuss](https://discuss.flarum.org/d/25182)
- [Packagist](https://packagist.org/packages/fof/oauth)
- [GitHub](https://github.com/FriendsOfFlarum/oauth)
- [Flarum 2.0 Upgrade guide for provider extensions](UPGRADE.md)

An extension by [FriendsOfFlarum](https://github.com/FriendsOfFlarum).

###  Health Score

61

—

FairBetter than 98% of packages

Maintenance75

Regular maintenance activity

Popularity47

Moderate usage in the ecosystem

Community40

Growing community involvement

Maturity74

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~39 days

Recently: every ~31 days

Total

52

Last Release

75d ago

Major Versions

0.3.0 → 1.0.02021-05-22

1.7.3 → 2.0.0-beta.12025-12-17

1.x-dev → 2.0.0-beta.22026-03-15

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/16573496?v=4)[IanM](/maintainers/imorland)[@imorland](https://github.com/imorland)

![](https://avatars.githubusercontent.com/u/1630413?v=4)[Gregor Hammerschmidt](/maintainers/GreXXL)[@GreXXL](https://github.com/GreXXL)

![](https://www.gravatar.com/avatar/0538135c1debcef5602dce7ece027909cc832b7a6284ab9189a19aa8de98d60d?d=identicon)[clarkwinkelmann](/maintainers/clarkwinkelmann)

![](https://www.gravatar.com/avatar/1298cdc0b2402a1aa34fb75a254947d655e090d62bd0531311331d369cac934e?d=identicon)[datitisev](/maintainers/datitisev)

---

Top Contributors

[![imorland](https://avatars.githubusercontent.com/u/16573496?v=4)](https://github.com/imorland "imorland (62 commits)")[![flarum-bot](https://avatars.githubusercontent.com/u/39334649?v=4)](https://github.com/flarum-bot "flarum-bot (44 commits)")[![dsevillamartin](https://avatars.githubusercontent.com/u/6401250?v=4)](https://github.com/dsevillamartin "dsevillamartin (21 commits)")[![clarkwinkelmann](https://avatars.githubusercontent.com/u/5264300?v=4)](https://github.com/clarkwinkelmann "clarkwinkelmann (20 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (11 commits)")[![Lier0](https://avatars.githubusercontent.com/u/28351075?v=4)](https://github.com/Lier0 "Lier0 (3 commits)")[![iPurpl3x](https://avatars.githubusercontent.com/u/18526076?v=4)](https://github.com/iPurpl3x "iPurpl3x (3 commits)")[![novacuum](https://avatars.githubusercontent.com/u/1344084?v=4)](https://github.com/novacuum "novacuum (3 commits)")[![luceos](https://avatars.githubusercontent.com/u/504687?v=4)](https://github.com/luceos "luceos (2 commits)")[![DavideIadeluca](https://avatars.githubusercontent.com/u/146922689?v=4)](https://github.com/DavideIadeluca "DavideIadeluca (2 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (2 commits)")[![iamdarkle](https://avatars.githubusercontent.com/u/15818451?v=4)](https://github.com/iamdarkle "iamdarkle (1 commits)")[![luuhai48](https://avatars.githubusercontent.com/u/39207570?v=4)](https://github.com/luuhai48 "luuhai48 (1 commits)")

---

Tags

facebookflarumfriendsofflarumgithublinkedinoauthtwitterfacebookgoogleoauthgithubgitlabtwitterlinkedindiscordflarumfriendsofflarum

### Embed Badge

![Health badge](/badges/fof-oauth/health.svg)

```
[![Health](https://phpackages.com/badges/fof-oauth/health.svg)](https://phpackages.com/packages/fof-oauth)
```

###  Alternatives

[hwi/oauth-bundle

Support for authenticating users using both OAuth1.0a and OAuth2 in Symfony.

2.4k22.3M81](/packages/hwi-oauth-bundle)[socialconnect/auth

Social Connect Auth Component

568893.3k5](/packages/socialconnect-auth)[and/oauth

Simple and amazing OAuth library with many providers. Just try it out!

4645.3k2](/packages/and-oauth)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
