PHPackages                             taufik-t/uauth-oidc-client - 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. taufik-t/uauth-oidc-client

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

taufik-t/uauth-oidc-client
==========================

OpenID Connect OAuth2 Provider for Laravel Socialite

0.0.11(2mo ago)1229MITPHPPHP ^8.1

Since Jul 11Pushed 2mo agoCompare

[ Source](https://github.com/ataufik135/uauth-oidc-client)[ Packagist](https://packagist.org/packages/taufik-t/uauth-oidc-client)[ Docs](https://github.com/ataufik135/uauth-oidc-client)[ RSS](/packages/taufik-t-uauth-oidc-client/feed)WikiDiscussions main Synced yesterday

READMEChangelogDependencies (6)Versions (7)Used By (0)

UAuth OpenID Connect (OIDC) Provider for Laravel Socialite
==========================================================

[](#uauth-openid-connect-oidc-provider-for-laravel-socialite)

[![Laravel Support: v9, v10, v11](https://camo.githubusercontent.com/59bc22f04872e73d2db2690bda243763a425a1c2d8a7c4afdbd2f808dd5a57ee/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c253230537570706f72742d76392532432532307631302532432532307631312d626c7565)](https://camo.githubusercontent.com/59bc22f04872e73d2db2690bda243763a425a1c2d8a7c4afdbd2f808dd5a57ee/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c253230537570706f72742d76392532432532307631302532432532307631312d626c7565) [![PHP Support: 8.1, 8.2, 8.3](https://camo.githubusercontent.com/7446a90723f3f06194bc686845a81275f2a55230681af9c10579574b5aed418c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f504850253230537570706f72742d382e31253243253230382e32253243253230382e332d626c7565)](https://camo.githubusercontent.com/7446a90723f3f06194bc686845a81275f2a55230681af9c10579574b5aed418c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f504850253230537570706f72742d382e31253243253230382e32253243253230382e332d626c7565)

Installation &amp; Basic Usage
------------------------------

[](#installation--basic-usage)

```
composer require taufik-t/uauth-oidc-client
```

Please see the [Base Installation Guide](https://socialiteproviders.com/usage/), then follow the provider specific instructions below.

### Add configuration to `config/services.php`

[](#add-configuration-to-configservicesphp)

```
'uauth' => [
    'base_url' => env('UAUTH_BASE_URL'),
    'client_id' => env('UAUTH_CLIENT_ID'),
    'client_secret' => env('UAUTH_CLIENT_SECRET'),
    'redirect' => env('UAUTH_REDIRECT_URI'),
],
```

The base URL must be set to the URL of your OIDC endpoint excluding the `.well-known/openid-configuration` part. For example: If `https://auth.application.com/.well-known/openid-configuration` is your OIDC configuration URL, then `https://auth.application.com` must be your base URL.

### Add provider event listener

[](#add-provider-event-listener)

Configure the package's listener to listen for `SocialiteWasCalled` events.

#### Laravel 11+

[](#laravel-11)

In Laravel 11, the default `EventServiceProvider` provider was removed. Instead, add the listener using the `listen` method on the `Event` facade, in your `AppServiceProvider` `boot` method.

```
Event::listen(function (\SocialiteProviders\Manager\SocialiteWasCalled $event) {
    $event->extendSocialite('uauth', \SocialiteProviders\UAuth\Provider::class);
});
```

#### Laravel 10 or below

[](#laravel-10-or-below)

Add the event to your listen\[\] array in `app/Providers/EventServiceProvider`. See the [Base Installation Guide](https://socialiteproviders.com/usage/) for detailed instructions.

```
protected $listen = [
    \SocialiteProviders\Manager\SocialiteWasCalled::class => [
        // ... other providers
        \SocialiteProviders\UAuth\UAuthExtendSocialite::class.'@handle',
    ],
];
```

### Usage

[](#usage)

You should now be able to use the provider like you would regularly use Socialite (assuming you have the facade installed):

```
return Socialite::driver('uauth')->redirect();
```

### Returned User fields

[](#returned-user-fields)

- `id`
- `name`
- `email`
- `username`
- `first_name`
- `last_name`
- `picture`
- `roles`
- `groups`

More fields are available under the `user` subkey:

```
$user = Socialite::driver('uauth')->user();

$locale = $user->user['locale'];
$email_verified = $user->user['email_verified'];
```

### Customizing the scopes

[](#customizing-the-scopes)

You may extend the default scopes (`openid email profile`) by adding a `scopes` option to your OIDC service configuration and separate multiple scopes with a space:

```
'uauth' => [
    'base_url' => env('UAUTH_BASE_URL'),
    'client_id' => env('UAUTH_CLIENT_ID'),
    'client_secret' => env('UAUTH_CLIENT_SECRET'),
    'redirect' => env('UAUTH_REDIRECT_URI'),

    'scopes' => 'roles groups',
    // or
    'scopes' => env('UAUTH_SCOPES'),
],
```

#### `config/uauth.php`

[](#configuauthphp)

```
'routes' => [
  'enabled' => env('UAUTH_ROUTES_ENABLED', true),
],
```

#### `.env`

[](#env)

```
UAUTH_BASE_URL="https://auth.application.com"
UAUTH_CLIENT_ID="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
UAUTH_CLIENT_SECRET="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
UAUTH_REDIRECT_URI="https://your-application.com/auth/callback"

// optional
UAUTH_SCOPES="roles groups"
UAUTH_ROUTES_ENABLED=true // ubah ke `false` untuk nonaktifkan default route
```

Jika default route dinonaktifkan, maka perlu membuat route untuk menangani autentikasi dengan route name `uauth.redirect`, `uauth.callback`, `uauth.logout` dapat dilihat pada package `routes/web.php` dan untuk controller `src/Controllers/AuthenticationController.php`.

Jika default route dinonaktifkan, developer tidak perlu mempublish vendor `migrations`, berikut untuk publish vendor:

```
php artisan vendor:publish --provider="SocialiteProviders\UAuth\UAuthServiceProvider"

# or
php artisan vendor:publish --tag=uauth
```

#### `config/app.php`

[](#configappphp)

```
'providers' => [
  /*
  * Package Service Providers...
  */
  // ...
  SocialiteProviders\UAuth\UAuthServiceProvider::class,
],
```

#### Middleware via routes

[](#middleware-via-routes)

```
Route::group(['middleware' => ['sso.auth']], function () {
  // authenticated users only
});
Route::group(['middleware' => ['sso.guest']], function () {
  // unauthenticated users only
});
Route::group(['middleware' => ['sso.auth', 'sso.role:user']], function () {
  // authenticated users with specified role only
});
Route::group(['middleware' => ['sso.auth', 'sso.role:user|admin|manager']], function () {
  // authenticated users with multiple roles
});
```

#### Middleware in controllers

[](#middleware-in-controllers)

```
public function __construct()
{
  $this->middleware('sso.auth');
  $this->middleware('sso.guest');
  $this->middleware('sso.role:user');
  $this->middleware('sso.role:user')->only(['index']);
  $this->middleware('sso.role:admin|manager')->only(['index','create']);
  $this->middleware('sso.role:manager')->except('destroy');
}
```

#### Blade directives

[](#blade-directives)

```
@ssoRole('admin')
Admin
@endSsoRole
//
@ssoRole('user|admin')
Home
@endSsoRole
//
@ssoRole(['user','admin'])
Home
@endSsoRole
```

#### Logout URL

[](#logout-url)

```
Logout

// redirect setelah logout ke url tertentu
Logout
```

---

Based on the work of [jp-gauthier](https://github.com/jp-gauthier)

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance86

Actively maintained with recent releases

Popularity15

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~58 days

Recently: every ~71 days

Total

6

Last Release

67d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4f4ed5d36e9ddf67b9200a994969ec003663f93e71b90472fc045ee0a4d3009c?d=identicon)[ataufik135](/maintainers/ataufik135)

---

Top Contributors

[![ataufik135](https://avatars.githubusercontent.com/u/16074652?v=4)](https://github.com/ataufik135 "ataufik135 (12 commits)")

---

Tags

laravelprovideroauthsocialiteoidc

### Embed Badge

![Health badge](/badges/taufik-t-uauth-oidc-client/health.svg)

```
[![Health](https://phpackages.com/badges/taufik-t-uauth-oidc-client/health.svg)](https://phpackages.com/packages/taufik-t-uauth-oidc-client)
```

###  Alternatives

[kovah/laravel-socialite-oidc

OpenID Connect OAuth2 Provider for Laravel Socialite

24134.2k](/packages/kovah-laravel-socialite-oidc)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[socialiteproviders/microsoft

Microsoft OAuth2 Provider for Laravel Socialite

347.3M26](/packages/socialiteproviders-microsoft)[api-platform/laravel

API Platform support for Laravel

58171.8k14](/packages/api-platform-laravel)[socialiteproviders/instagram

Instagram OAuth2 Provider for Laravel Socialite

402.0M5](/packages/socialiteproviders-instagram)[hasinhayder/tyro

Tyro - The ultimate Authentication, Authorization, and Role &amp; Privilege Management solution for Laravel 12 &amp; 13

6804.7k6](/packages/hasinhayder-tyro)

PHPackages © 2026

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