PHPackages                             gcgov/framework-service-auth-oauth-server - 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. gcgov/framework-service-auth-oauth-server

ActiveFramework-service[Authentication &amp; Authorization](/categories/authentication)

gcgov/framework-service-auth-oauth-server
=========================================

Plugin enables a full fledged oauth server generating access and refresh tokens. Authentication can be provided as username/password or via third party Oauth providers.

v2.2.1(1mo ago)0106MITPHPPHP &gt;=8.2CI passing

Since Aug 7Pushed 2w ago1 watchersCompare

[ Source](https://github.com/gcgov/framework-service-auth-oauth-server)[ Packagist](https://packagist.org/packages/gcgov/framework-service-auth-oauth-server)[ RSS](/packages/gcgov-framework-service-auth-oauth-server/feed)WikiDiscussions main Synced 2w ago

READMEChangelog (10)Dependencies (32)Versions (20)Used By (0)

Oauth Server Service
====================

[](#oauth-server-service)

Service to extend gcgov/framework
---------------------------------

[](#service-to-extend-gcgovframework)

### Primary purpose

[](#primary-purpose)

- Implement a full Oauth service for authenticating to app. Provides functionality to authenticate users via third party Oauth providers or username/password database.

### Impact to application

[](#impact-to-application)

- Router:
    - Adds routes:
        - Adds route `/.well-known/jwks.json` - provides endpoint to enable front end validation of tokens generated by the app
        - Adds route `/.well-known/openid-configuration` - provides public oauth configuration endpoint
        - Adds route `/auth/fileToken` - create a short lived access token that can be used in the url for supported routes
        - Adds route `/auth/out` - kills refresh token for user and removes any session and cookie data
        - Adds route `/auth/authorize` - GET and POST for authenticating user and generating access and refresh tokens
        - Adds route `/auth/hybridauth/{provider}` - Return endpoint for third party Oauth providers
        - Adds route `/auth/verifyMfaSecret` - used to configure user by validating MFA code and saving MFA secret for user
        - Adds route `/auth/verifyMfaCode` - for validating an MFA code for a user with MFA already configured
    - Adds authentication guard:
        - All routes in application with `authentication=true` must pass this guard. Checks the HTTP Authorization header, or url parameter `fileAccessToken` for routes with `allowShort`.

Installation:
-------------

[](#installation)

- Require using Composer
- Add namespace `\gcgov\framework\services\authoauth` to `\app\app->registerFrameworkServiceNamespaces()`

Configuration
-------------

[](#configuration)

### Allowed Users

[](#allowed-users)

By default, users attempting to sign in who not already present in the user database collection will be prevented from signing in. To enable sign in for any user who passes the third party Oauth provider authentication, set config variable `blockNewUsers=false`. When `blockNewUsers=false`, any user successfully authenticated by the third party Oauth provider will be automatically added to the database user config

```
$oauthConfig = oauthConfig::getInstance();
$oauthConfig->setBlockNewUsers( false );
```

### New User Default Roles

[](#new-user-default-roles)

When `blockNewUsers=false`, new users will be automatically added to the user database collection. To set the default roles that a new user should be assigned at creation, provide the roles to the `setBlockNewUsers` method.

```
$oauthConfig = oauthConfig::getInstance();
$oauthConfig->setBlockNewUsers( false, [ 'Role1.Read', 'Role2.Read', 'Role2.Write' ] );
```

###  Health Score

49

—

FairBetter than 94% of packages

Maintenance95

Actively maintained with recent releases

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 75% 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 ~82 days

Recently: every ~104 days

Total

14

Last Release

34d ago

Major Versions

v1.3.2 → v2.0.02025-08-28

PHP version history (2 changes)v1.0.0PHP &gt;=8.1

v1.3.0PHP &gt;=8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/e97ad9c5583ee03e1f670eba13bd11b81e3374da1941dce10f6da80e5dc6d8eb?d=identicon)[andrewsauder](/maintainers/andrewsauder)

---

Top Contributors

[![andrewsauder](https://avatars.githubusercontent.com/u/1380472?v=4)](https://github.com/andrewsauder "andrewsauder (18 commits)")[![claude](https://avatars.githubusercontent.com/u/81847?v=4)](https://github.com/claude "claude (6 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/gcgov-framework-service-auth-oauth-server/health.svg)

```
[![Health](https://phpackages.com/badges/gcgov-framework-service-auth-oauth-server/health.svg)](https://phpackages.com/packages/gcgov-framework-service-auth-oauth-server)
```

###  Alternatives

[scheb/2fa

Two-factor authentication for Symfony applications (please use scheb/2fa-bundle to install)

589701.7k2](/packages/scheb-2fa)[scheb/2fa-trusted-device

Extends scheb/2fa-bundle with trusted devices support

366.0M40](/packages/scheb-2fa-trusted-device)[contao/core-bundle

Contao Open Source CMS

1301.7M3.1k](/packages/contao-core-bundle)[fleetbase/core-api

Core Framework and Resources for Fleetbase API

1239.7k25](/packages/fleetbase-core-api)[stephenjude/filament-two-factor-authentication

Filament Two Factor Authentication: Google 2FA + Passkey Authentication

85240.3k9](/packages/stephenjude-filament-two-factor-authentication)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3915.5k](/packages/rawilk-profile-filament-plugin)

PHPackages © 2026

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