PHPackages                             accentinteractive/laravel-sso - 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. accentinteractive/laravel-sso

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

accentinteractive/laravel-sso
=============================

Azure AD SSO (Single Sign On) login management for Laravel.

v1.0.3(1y ago)024MITPHPPHP ^7.3|^8.0

Since Aug 7Pushed 1y ago2 watchersCompare

[ Source](https://github.com/accentinteractive/laravel-sso)[ Packagist](https://packagist.org/packages/accentinteractive/laravel-sso)[ Docs](https://github.com/accentinteractive/laravel-sso)[ RSS](/packages/accentinteractive-laravel-sso/feed)WikiDiscussions master Synced 1mo ago

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

Azure AD SSO login management for Laravel
=========================================

[](#azure-ad-sso-login-management-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/29e34a64132870d5a68cdf30c471cced7b46dbebc6b27950ed00dcb567029c8c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616363656e74696e7465726163746976652f6c61726176656c2d6c6f67636c65616e65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/accentinteractive/laravel-logcleaner)[![Build Status](https://camo.githubusercontent.com/6dc33aedc4aea68125f8ebea51499e1e0a28eb63e80e2d03fd4cbfe63ef5f3c5/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f616363656e74696e7465726163746976652f6c61726176656c2d6c6f67636c65616e65722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/accentinteractive/laravel-logcleaner)[![Quality Score](https://camo.githubusercontent.com/b6486675eb8b873afdb0d3223cada8877acd37ed6486f6964500f00f49faeff6/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f616363656e74696e7465726163746976652f6c61726176656c2d6c6f67636c65616e65722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/accentinteractive/laravel-logcleaner)[![Total Downloads](https://camo.githubusercontent.com/c1e84f783b29978e646907dbce61227c1c3cb9e23410ec598f9e52381487181c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616363656e74696e7465726163746976652f6c61726176656c2d6c6f67636c65616e65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/accentinteractive/laravel-logcleaner)

- [Installation](#installation)
- [Register a new Azure AD application](#register-a-new-azure-ad-application)
- [Config settings](#config-settings)

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

[](#installation)

You can install the package via composer:

Step 1
------

[](#step-1)

```
composer require accentinteractive/laravel-sso
```

Step 2
------

[](#step-2)

Register your application with the Azure portal. You need a valid Microsoft account and the proper authorization for your company. For a full manual, see [Registering a new Azure AD application](#register-a-new-azure-ad-application).

Step 3
------

[](#step-3)

Once your have registered the application with Azure AD, add the proper credentials to your .env file. Get the proper IDs and secrets from

```
SSO_ENABLED=true

# App Registrations › Application › Application (client) ID
SSO_CLIENT_ID="YOUR_CLIENT_ID_HERE"

# App Registrations › Application › Directory (tenant) ID
SSO_TENANT_ID="YOUR_TENANT_ID_HERE"

# App Registrations › Application › Client credentials › New client secret
SSO_CLIENT_SECRET="YOUR_CLIENT_SECRET_HERE"

# App Registrations › Application › Redirect URIs (platform 'Web')
SSO_CLIENT_REDIRECT_URL="https://YOURDOMAIN.COM/login"

SSO_AUTH_TENANT=common
```

Step 4
------

[](#step-4)

Add the middleware to your 'web' middleware group to place all endpoints behind SSO, or to another group if you want to guard only several of your endpoints.. `\Accentinteractive\LaravelSso\Http\Middleware\AuthenticateSSO::class,`

For Laravel &gt;10, place it in bootstrap/app.php.

```
// [...]
->withMiddleware(function (Middleware $middleware) {

    // Register multitenancy middleware
    $middleware->appendToGroup('web', [
        \Accentinteractive\LaravelSso\Http\Middleware\AuthenticateSSO::class,
    ]);
```

For Laravel &lt;=10, place it in app/Http/Kernel.php.

```
'web' => [
    // [...]
    \Accentinteractive\LaravelSso\Http\Middleware\AuthenticateSSO::class,
],
```

Step 5
------

[](#step-5)

Optionally you can publish the config file with:

```
php artisan vendor:publish --provider="Accentinteractive\LaravelSso\LaravelSsoServiceProvider" --tag="config"

```

Register a new Azure AD application
-----------------------------------

[](#register-a-new-azure-ad-application)

For Azure AD Single Sign On to work properly, you must supply the following Azure AD credentials in your .env file:

- `Application (client) ID`
- `Directory (tenant) ID`
- `Client Secret`
- `Redirect URI`

Important: your Client Secret has an expiration date. Before the secret expires, make sure to create another new secret and supply it in in .env, so you employees can continue to log using SSO. A good expiration time would be 12 or 24 months.

- To create the Azure AD Plan Ahead application. IDs and secrets, do the following;
    - Go to Azure AD while logged in as Microsoft User for your organization: .
    - Go to App Registrations ([https://portal.azure.com/#view/Microsoft\_AAD\_RegisteredApps/ApplicationsListBlade](https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade)).
    - Click 'New Registration' to add your application.
        - Enter a name.
        - Select 'Accounts in this organizational directory only'.
        - Click 'Register'.
    - Make note of the `Application (client) ID`
    - Make note of the `Directory (tenant) ID`
    - Click 'Redirect URIs'.
        - Under 'Web', click 'Add URI'.
        - Enter the correct redirect URI () and hit \[ENTER\]
        - Make note of the redirect URL.
    - Go back to the app Registration and click 'Client Credentials'.
        - Click 'New Client Secret'.
        - Enter a name for the secret.
        - Choose an expiry period (maximum 24 months).
        - Click 'Add'.
        - Make note of the 'Value' for your Client secret. Important: You can only view a secret once, directly after creation.
    - Go back to the app Registration and go to Manage › Manifest.
        - In the XML, edit "allowPublicClient" to say false.
        - In the XML, edit "oauth2AllowIdTokenImplicitFlow" to say true.
        - Click Save.
    - Before the secret expires, make sure to create another new secret and enter it to to your .env file in time, so you can continue to log with SSO.

Config settings
---------------

[](#config-settings)

You can pass config settings to modify the behaviour.

You can also pass options directly.

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

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

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

[](#contributing)

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

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Joost van Veen](https://github.com/accentinteractive)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity48

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

Total

5

Last Release

640d ago

Major Versions

v0.0.1 → v1.0.02024-08-07

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/356020?v=4)[Accent Interactive](/maintainers/accentinteractive)[@accentinteractive](https://github.com/accentinteractive)

---

Top Contributors

[![joostvanveen](https://avatars.githubusercontent.com/u/540294?v=4)](https://github.com/joostvanveen "joostvanveen (11 commits)")

---

Tags

accentinteractivelaravel-sso

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/accentinteractive-laravel-sso/health.svg)

```
[![Health](https://phpackages.com/badges/accentinteractive-laravel-sso/health.svg)](https://phpackages.com/packages/accentinteractive-laravel-sso)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M683](/packages/barryvdh-laravel-ide-helper)[laravel/ui

Laravel UI utilities and presets.

2.7k134.9M597](/packages/laravel-ui)[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M157](/packages/orchestra-canvas)[casbin/laravel-authz

An authorization library that supports access control models like ACL, RBAC, ABAC in Laravel.

324339.9k4](/packages/casbin-laravel-authz)[sammyjo20/lasso

Lasso - Asset wrangling for Laravel made simple.

355347.9k](/packages/sammyjo20-lasso)[andrewdwallo/filament-companies

A comprehensive Laravel authentication and authorization system designed for Filament, focusing on multi-tenant company management.

34450.0k2](/packages/andrewdwallo-filament-companies)

PHPackages © 2026

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