PHPackages                             mfc/oauth2 - 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. mfc/oauth2

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

mfc/oauth2
==========

Generic OAuth2 authentication and authorization for TYPO3 CMS

4.3.0(1w ago)11310.1k↓34.5%19[4 issues](https://github.com/marketing-factory/oauth2/issues)2GPL-2.0-or-laterPHPPHP ^8.2CI failing

Since Jun 23Pushed 1w ago5 watchersCompare

[ Source](https://github.com/marketing-factory/oauth2)[ Packagist](https://packagist.org/packages/mfc/oauth2)[ Docs](https://www.marketing-factory.de)[ RSS](/packages/mfc-oauth2/feed)WikiDiscussions 4.x Synced 2d ago

READMEChangelog (10)Dependencies (35)Versions (57)Used By (2)

TYPO3 Extension `oauth2` (`mfc/oauth2`)
=======================================

[](#typo3-extension-oauth2-mfcoauth2)

[![Latest Stable Version](https://camo.githubusercontent.com/5c3d0a45c9133094deb623856791e5cf66ae08700d8204e83f0fd34751b9c747/68747470733a2f2f706f7365722e707567782e6f72672f6d66632f6f61757468322f762f737461626c65)](https://packagist.org/packages/mfc/oauth2)[![License](https://camo.githubusercontent.com/a3c8e58e9bc69fcf658e8ebdc49c9debd20a34219cb3c3ffc9700dc4cf700d63/68747470733a2f2f706f7365722e707567782e6f72672f6d66632f6f61757468322f6c6963656e7365)](https://packagist.org/packages/mfc/oauth2)

This extension provides OAuth 2.0 authentication for TYPO3 installations.

[Read more](https://www.marketing-factory.com/services/programming-and-development/custom-development/oauth2/)

1. Features
-----------

[](#1-features)

- Can automatically create new backend users
- Certain OAuth resource servers can control admin permissions and assign backend group memberships

2. Usage
--------

[](#2-usage)

### 1) Installation

[](#1-installation)

The only way to install this extension is by using [Composer](https://getcomposer.org/). In your Composer based TYPO3 project root, just run `composer require mfc/oauth2`.

### 2) Configure the extension

[](#2-configure-the-extension)

To add an OAuth2 Server for login, we recommend you create your own little extension, use your existing site package or put the configuration in your `config/system/additional.php`.

#### 2.1) Using the GitLab Provider included in this extension

[](#21-using-the-gitlab-provider-included-in-this-extension)

Configuring the GitLab Login Provider is pretty straight forward. Just put the following configuration into your `ext_localconf.php`or the aforementioned `config/system/additional.php` and customize it to your needs.

```
Mfc\OAuth2\ResourceServer\Registry::addServer(
    'gitlab', // identifier for the Resource Server
    'Login with GitLab', // Text displayed on the Login Screen
    \Mfc\OAuth2\ResourceServer\GitLab::class,
    [
        'enabled'   => true, // Enable/Disable the provider
        'arguments' => [
            'appId'                => 'your-app-id',
            'appSecret'            => 'your-app-secret',
            'gitlabServer'         => 'https://gitlab.com', // Your GitLab Server
            'gitlabAdminUserLevel' => \Mfc\OAuth2\ResourceServer\GitLab::USER_LEVEL_DEVELOPER, // User level at which the user will be given admin permissions
            'gitlabDefaultGroups'  => '0', // Groups to assign to the User (comma separated list possible)
            'gitlabUserOption'     => 0, // UserConfig
            'blockExternalUser'    => false, // Blocks users with flag external from access the backend
            'projectName'          => 'your/repo', // the repository from which user information is fetched
        ],
    ]
);
```

You can obtain the required information for the provider by going to either  if you're using the hosted version of GitLab, or to the equivalent page on your self-hosted GitLab server.

When creating the application within GitLab, you might need the following information:

- Redirect URI: `/typo3/index.php`
- Scopes: `read_api`,`read_user`,`openid`

#### 2.2) Creating your own provider

[](#22-creating-your-own-provider)

To create your own Provider, you need to create your own extension, and create a class which extends `Mfc\OAuth2\ResourceServer\AbstractResourceServer`. You can then use the same boilerplate shown in 2.1 to register your newly created provider. The `arguments` array included in the provider registration will be provided as-is as the first argument to your providers constructor, with the addition of a `providerName` key which contains the identifier you set in your registration.

**Example**

You've created your own extension, and created the class `Just\AnExample\Providers\ExampleProvider`. To register your provider you'd extend the configuration as follows

```
Mfc\OAuth2\ResourceServer\Registry::addServer(
    'example-provider', // identifier for the Resource Server
    'Login with Example', // Text displayed on the Login Screen
    \Just\AnExample\Providers\ExampleProvider::class,
    [
        'enabled'   => true, // Enable/Disable the provider
        'arguments' => [
            'yourarg' => 'somevalue',
            // ...
        ],
    ]
);
```

The first argument passed to your provider will be:

```
array(
    'providerName' => 'example-provider',
    'yourarg' => 'somevalue',
    // ...
);
```

#### 2.3) Change the default Cookie Settings in TYPO3

[](#23-change-the-default-cookie-settings-in-typo3)

To use the redirect mechanism of oAuth you must allow lax cookie settings for TYPO3: [cookieSameSite ](https://docs.typo3.org/permalink/t3coreapi:confval-globals-typo3-conf-vars-be-cookiesamesite)must be set to 'lax'.

```
$GLOBALS['TYPO3_CONF_VARS']['BE']['cookieSameSite'] = 'lax'
```

3. License
----------

[](#3-license)

mfc/oauth2 is released under the terms of the [GPL-2 License](LICENSE.md).

4. Support
----------

[](#4-support)

Free Support is available via [Github Issue Tracker](https://github.com/marketing-factory/oauth2/issues) For commercial support, please contact us at [info@marketing-factory.de](info@marketing-factory.de)

###  Health Score

67

—

FairBetter than 99% of packages

Maintenance91

Actively maintained with recent releases

Popularity45

Moderate usage in the ecosystem

Community28

Small or concentrated contributor base

Maturity89

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 66.2% of commits — single point of failure

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 ~57 days

Recently: every ~12 days

Total

52

Last Release

8d ago

Major Versions

2.0.1 → 3.0.02021-04-29

1.15.x-dev → 3.0.12022-01-17

2.0.2 → 3.0.52022-09-16

2.x-dev → 3.0.62023-02-15

3.x-dev → 4.0.02025-04-24

PHP version history (5 changes)0.0.1-betaPHP ^7.2

0.1.0PHP ^7.1

3.0.0PHP ^7.4||^8.0

3.1.0PHP ^7.4 || ^8.1

4.1.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/82a4f3fa125541cd587bbf5db91e51a64d89d36f9c1ca07fcfba271a5661a730?d=identicon)[cspoo](/maintainers/cspoo)

![](https://avatars.githubusercontent.com/u/5294925?v=4)[Simon Schmidt](/maintainers/sfsmfc)[@sfsmfc](https://github.com/sfsmfc)

---

Top Contributors

[![tehplague](https://avatars.githubusercontent.com/u/1062568?v=4)](https://github.com/tehplague "tehplague (90 commits)")[![ischmittis](https://avatars.githubusercontent.com/u/904789?v=4)](https://github.com/ischmittis "ischmittis (16 commits)")[![garbast](https://avatars.githubusercontent.com/u/5036924?v=4)](https://github.com/garbast "garbast (8 commits)")[![infabo](https://avatars.githubusercontent.com/u/3999104?v=4)](https://github.com/infabo "infabo (6 commits)")[![sebkln](https://avatars.githubusercontent.com/u/13318555?v=4)](https://github.com/sebkln "sebkln (4 commits)")[![zenobio93](https://avatars.githubusercontent.com/u/5907705?v=4)](https://github.com/zenobio93 "zenobio93 (4 commits)")[![kellerrennkadse](https://avatars.githubusercontent.com/u/40218022?v=4)](https://github.com/kellerrennkadse "kellerrennkadse (2 commits)")[![mbrodala](https://avatars.githubusercontent.com/u/5037116?v=4)](https://github.com/mbrodala "mbrodala (1 commits)")[![mtelgkamp](https://avatars.githubusercontent.com/u/33117529?v=4)](https://github.com/mtelgkamp "mtelgkamp (1 commits)")[![bernhardberger](https://avatars.githubusercontent.com/u/2110083?v=4)](https://github.com/bernhardberger "bernhardberger (1 commits)")[![florianleimer](https://avatars.githubusercontent.com/u/44466890?v=4)](https://github.com/florianleimer "florianleimer (1 commits)")[![tlueder](https://avatars.githubusercontent.com/u/5957131?v=4)](https://github.com/tlueder "tlueder (1 commits)")[![christian-fries](https://avatars.githubusercontent.com/u/852644?v=4)](https://github.com/christian-fries "christian-fries (1 commits)")

---

Tags

oauth2typo3typo3-cms-extensionoauthTYPO3 CMS

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/mfc-oauth2/health.svg)

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

###  Alternatives

[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[thenetworg/oauth2-azure

Azure Active Directory OAuth 2.0 Client Provider for The PHP League OAuth2-Client

25310.7M82](/packages/thenetworg-oauth2-azure)[league/oauth2-google

Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client

42223.4M176](/packages/league-oauth2-google)[stevenmaguire/oauth2-keycloak

Keycloak OAuth 2.0 Client Provider for The PHP League OAuth2-Client

2306.4M45](/packages/stevenmaguire-oauth2-keycloak)[pagemachine/typo3-formlog

Form log for TYPO3

23238.6k8](/packages/pagemachine-typo3-formlog)[patrickbussmann/oauth2-apple

Sign in with Apple OAuth 2.0 Client Provider for The PHP League OAuth2-Client

1152.8M12](/packages/patrickbussmann-oauth2-apple)

PHPackages © 2026

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