PHPackages                             wishtreehkumar/azureadsso - 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. wishtreehkumar/azureadsso

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

wishtreehkumar/azureadsso
=========================

Azure Active Directory SSO Login flow

03PHP

Since Nov 21Pushed 3y ago1 watchersCompare

[ Source](https://github.com/wishtree-hkumar/azureadsso)[ Packagist](https://packagist.org/packages/wishtreehkumar/azureadsso)[ RSS](/packages/wishtreehkumar-azureadsso/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Project Description
===================

[](#project-description)

This package will help you easily implement the Azure Active Directory SSO Login and Graph API Access.

Installation Steps
------------------

[](#installation-steps)

---

```
composer require wishtreehkumar/azureadsso

```

### To edit config file

[](#to-edit-config-file)

```
php artisan vendor:publish --provider="Wishtreehkumar\Azureadsso\ServiceProvider" --tag="config"

```

How to use
----------

[](#how-to-use)

---

### Set .env

[](#set-env)

```
AZURE_AD_CLIENT_SECRET=--
AZURE_AD_CLIENT_ID=--
AZURE_AD_TENANT_ID=--

AZURE_AD_TENANT_NAME=--
AZURE_AD_POLICY_NAME=--

AZURE_AD_CALLBACK_URI=--

```

Generate Password
-----------------

[](#generate-password)

```
use Wishtreehkumar\Azureadsso\Facades\AzureAD;

$password = AzureAD::generatePassword();

```

Generate Login URL
------------------

[](#generate-login-url)

```
- There are two type of Azure AD:
    - b2c
    - normal

$url = AzureAD::generateLoginUrl('b2c');

return redirect()->away($url);

```

Validate id\_token in callback url
----------------------------------

[](#validate-id_token-in-callback-url)

```
$azureAd = AzureAD::construct($request->id_token, 'b2c');

if ($azureAd->isAuthenticated()) {
    $azurePayload = $azureAd->getPayload();
}

```

Call Graph API
--------------

[](#call-graph-api)

```
$grapApi = AzureAD::graphApi($method, $endPoint, $body);

```

### EG: For create B2C User:

[](#eg-for-create-b2c-user)

```
$dataBody = [
    'accountEnabled' => true,
    'displayName' => "Your Company",
    'identities' => [
        [
            'signInType' => 'emailAddress',
            'issuer' => 'your_tenet.onmicrosoft.com',
            'issuerAssignedId' => 'your_email@example.com',
        ],
    ],
    'passwordProfile' => [
        'password' => $password,
        'forceChangePasswordNextSignIn' => false,
    ],
    'passwordPolicies' => 'DisablePasswordExpiration',
];

$grapApi = AzureAD::graphApi('post', 'users', $dataBody);

dd($grapApi->object());

```

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity23

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/bfb9eec5f68c10e608f09f4e14853d37f2d99361436ed7e396998702a2b5d62b?d=identicon)[wishtree-hkumar](/maintainers/wishtree-hkumar)

---

Top Contributors

[![example](https://avatars.githubusercontent.com/u/57936?v=4)](https://github.com/example "example (10 commits)")

### Embed Badge

![Health badge](/badges/wishtreehkumar-azureadsso/health.svg)

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

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[league/oauth2-google

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

41721.2M117](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)

PHPackages © 2026

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