PHPackages                             chrisreedio/socialment-bastion-azure - 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. chrisreedio/socialment-bastion-azure

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

chrisreedio/socialment-bastion-azure
====================================

Provides a Bridge between Socialment, Bastion, and Azure AD.

v4.1.0(3mo ago)13.5k↓13.9%[4 PRs](https://github.com/chrisreedio/socialment-bastion-azure/pulls)MITPHPPHP ^8.2CI passing

Since Nov 3Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/chrisreedio/socialment-bastion-azure)[ Packagist](https://packagist.org/packages/chrisreedio/socialment-bastion-azure)[ Docs](https://github.com/chrisreedio/socialment-bastion-azure)[ GitHub Sponsors](https://github.com/chrisreedio)[ RSS](/packages/chrisreedio-socialment-bastion-azure/feed)WikiDiscussions 4.x Synced 1mo ago

READMEChangelog (10)Dependencies (15)Versions (21)Used By (0)

Socialment, Bastion, and Azure AD Unified Integration
=====================================================

[](#socialment-bastion-and-azure-ad-unified-integration)

[![Latest Version on Packagist](https://camo.githubusercontent.com/74ec63217ce5332d8aff904bd2890f5814491c85f4fd447137cfcee7d9089780/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636872697372656564696f2f736f6369616c6d656e742d62617374696f6e2d617a7572652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/chrisreedio/socialment-bastion-azure)[![GitHub Tests Action Status](https://camo.githubusercontent.com/4b542bd0b5dedb17e5555b1441acb1eccd46693b405ca542c33683a82c05ff94/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f636872697372656564696f2f736f6369616c6d656e742d62617374696f6e2d617a7572652f72756e2d74657374732e796d6c3f6272616e63683d332e78266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/chrisreedio/socialment-bastion-azure/actions?query=workflow%3Arun-tests+branch%3A3.x)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/58b813840d6780b80ea217fa89d295d4fcc72ba8c6c0c317dc71edb416c773cb/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f636872697372656564696f2f736f6369616c6d656e742d62617374696f6e2d617a7572652f6669782d7068702d636f64652d7374796c696e672e796d6c3f6272616e63683d332e78266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/chrisreedio/socialment-bastion-azure/actions?query=workflow%3A%22Fix+PHP+Code+Styling%22+branch%3A3.x)[![Total Downloads](https://camo.githubusercontent.com/c38b69c4f10d1f6577ac0d856e68fac8afef7fbbd1996b7afa3300d637ad10e9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636872697372656564696f2f736f6369616c6d656e742d62617374696f6e2d617a7572652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/chrisreedio/socialment-bastion-azure)

This is a ***highly*** opinionated package that provides a bridge between [Socialment](https://github.com/chrisreedio/socialment), [Bastion](https://github.com/chrisreedio/bastion), and [Azure AD](https://github.com/chrisreedio/laravel-azure-graph).

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require chrisreedio/socialment-bastion-azure
```

Then execute and follow the prompts:

```
php artisan socialment-bastion-azure:install
```

Include this plugin in your panel configuration:

```
$panel
    ->plugins([
        // ... Other Plugins
        \ChrisReedIO\Bastion\BastionPlugin::make(),
        \ChrisReedIO\Socialment\SocialmentPlugin::make()
            ->registerProvider('azure', 'fab-microsoft', 'Azure Active Directory'),
	])
```

Remember to add the Spatie `HasRoles` trait to your `User` model.

```
use Spatie\Permission\Traits\HasRoles;

class User extends Authenticatable
{
    use HasRoles;
}
```

This additional *glue* package will automagically hook the pre-login callbacks from Socialment into Bastion's Roles via the SSO Group field.

### Seeder

[](#seeder)

If you're choosing to use the seeder(s) make sure you add the `RoleSeeder` to your `DatabaseSeeder.php` like this:

```
$this->call([
    // ... Other Seeders
    RoleSeeder::class,
]);
```

Also don't forget to edit the `RoleSeeder.php` to add your own SSO Groups to each Role.

Some example roles have been placed there for you.

Azure App Registration
----------------------

[](#azure-app-registration)

### Redirect URL

[](#redirect-url)

Ensure that you configure the redirect URL on your app registration and that it matches the value in your `.env` file.

```
AZURE_REDIRECT_URI=https://yourdomain.com/login/azure/callback
```

### Azure Permissions

[](#azure-permissions)

You will need to grant your app registration the following permissions:

- `Directory.Read.All`
- `GroupMember.Read.All`
- `User.Read`

### Config

[](#config)

By default, the config does not get published upon install.

This is the contents of the published config `services.php` file:

*It is just the stock services file with the `azure` block added.*

```
return [
    'mailgun' => [
        'domain' => env('MAILGUN_DOMAIN'),
        'secret' => env('MAILGUN_SECRET'),
        'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'),
        'scheme' => 'https',
    ],

    'postmark' => [
        'token' => env('POSTMARK_TOKEN'),
    ],

    'ses' => [
        'key' => env('AWS_ACCESS_KEY_ID'),
        'secret' => env('AWS_SECRET_ACCESS_KEY'),
        'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
    ],

    'azure' => [
        'client_id' => env('AZURE_CLIENT_ID'),
        'client_secret' => env('AZURE_CLIENT_SECRET'),
        'redirect' => env('AZURE_REDIRECT_URI'),
        'tenant' => env('AZURE_TENANT_ID'),
        'proxy' => env('PROXY')  // Optional
    ],

];
```

You may publish the config after installation with:

```
php artisan vendor:publish --tag="socialment-bastion-azure-config"
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Chris Reed](https://github.com/chrisreedio)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance86

Actively maintained with recent releases

Popularity24

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 82.4% 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 ~64 days

Recently: every ~42 days

Total

14

Last Release

99d ago

Major Versions

v3.0.0 → v4.0.0-beta.12025-08-25

PHP version history (2 changes)v3.0.0-beta1PHP ^8.1

v3.0.0-beta5PHP ^8.2

### Community

Maintainers

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

---

Top Contributors

[![chrisreedio](https://avatars.githubusercontent.com/u/77644584?v=4)](https://github.com/chrisreedio "chrisreedio (75 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (10 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (6 commits)")

---

Tags

laravelchrisreediosocialment-bastion-azure

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/chrisreedio-socialment-bastion-azure/health.svg)

```
[![Health](https://phpackages.com/badges/chrisreedio-socialment-bastion-azure/health.svg)](https://phpackages.com/packages/chrisreedio-socialment-bastion-azure)
```

###  Alternatives

[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[jeffgreco13/filament-breezy

A custom package for Filament with login flow, profile and teams support.

1.0k1.7M41](/packages/jeffgreco13-filament-breezy)[dutchcodingcompany/filament-socialite

Social login for Filament through Laravel Socialite

213914.9k9](/packages/dutchcodingcompany-filament-socialite)[stephenjude/filament-two-factor-authentication

Filament Two Factor Authentication: Google 2FA + Passkey Authentication

81158.7k4](/packages/stephenjude-filament-two-factor-authentication)[chrisreedio/socialment

Provides Socialite functionality for Filament.

10884.8k1](/packages/chrisreedio-socialment)[marcelweidum/filament-passkeys

Use passkeys in your filamentphp app

5925.8k](/packages/marcelweidum-filament-passkeys)

PHPackages © 2026

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