PHPackages                             wika-group/azureadb2c-spa-for-laravel-wire-extender - 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. wika-group/azureadb2c-spa-for-laravel-wire-extender

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

wika-group/azureadb2c-spa-for-laravel-wire-extender
===================================================

Use Azure AD B2C single sign-on with Laravel Wire Extender components

2.0.0(2mo ago)0283↓73.1%MITPHP

Since Feb 16Pushed 2mo agoCompare

[ Source](https://github.com/WIKA-Group/azureadb2c-spa-for-laravel-wire-extender)[ Packagist](https://packagist.org/packages/wika-group/azureadb2c-spa-for-laravel-wire-extender)[ RSS](/packages/wika-group-azureadb2c-spa-for-laravel-wire-extender/feed)WikiDiscussions main Synced 3d ago

READMEChangelog (3)Dependencies (4)Versions (4)Used By (0)

Azure AD B2C single sign-on for Laravel single-page applications
================================================================

[](#azure-ad-b2c-single-sign-on-for-laravel-single-page-applications)

This composer package provides the necessary logic to handle Azure B2C logins with MSAL for [wire-extender](https://github.com/wire-elements/wire-extender) components in the front end (with a pop-up) and back-end validation. It requires Livewire and Wire Extender.

> You must [Enable browser session support](https://wire-elements.dev/blog/embed-livewire-components-using-wire-extender).

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

[](#installation)

**Install the package:**

```
composer require wika-group/azureadb2c-spa-for-laravel-wire-extender
```

**Publish assets:**

```
php artisan vendor:publish --tag=azureb2cspa-assets
```

**Publish migration:**

```
php artisan vendor:publish --tag=azureb2cspa-migrations
```

**Extend .env and configure:**

```
AADB2C_TENANT_ID=
AADB2C_CLIENT_ID=
AADB2C_DOMAIN=            # {your_domain}.b2clogin.com
AADB2C_CUSTOM_DOMAIN=     # Optional: set to use custom domain e.g. login.contoso.com
AADB2C_POLICY=            # Optional - Default: 'B2C_1_sign-up_and_sign-in_policy'
AADB2C_DEFAULT_ALGORITHM= # Optional: Decoding algorithm JWK key. Default: 'RS256'
AADB2C_OAUTH_COLUMN=      # Optional: Name of the OAuth ID column. Default 'oauth_id'
```

**Optional: Publish config:**

```
php artisan vendor:publish --tag=azureb2cspa-config
```

Usage
-----

[](#usage)

### Add scripts to your views

[](#add-scripts-to-your-views)

```

```

In order to trigger a Livewire re-render, an event listener is required.
Therefore, the provided trait can be used inside the main Livewire component.

```
use \WikaGroup\AzureAdB2cSpa\Traits\LoginLogoutEvents;
```

### Add a button to trigger login or logout

[](#add-a-button-to-trigger-login-or-logout)

```
@auth
    Logout
@endauth
@guest
    Login with Azure B2C
@endguest
```

### Hook into the events

[](#hook-into-the-events)

You can add custom logic by using the emitted events for login and logout:

```
#[On('azureb2c-login-succeeded')]
public function azureB2cLoginSucceeded() {
    $userData = session('azureb2c-user-data');
}

#[On('azureb2c-login-failed')]
public function azureB2cLoginFailed(string $msg) {}

#[On('azureb2c-logout-succeeded')]
public function azureB2cLogoutSucceeded() {}

#[On('azureb2c-logout-failed')]
public function azureB2cLogoutFailed(string $msg) {}
```

### Configure Azure B2C

[](#configure-azure-b2c)

You must add the URL of the SPA in the Azure Portal:

[![](https://github.com/WIKA-Group/azureadb2c-spa-for-laravel-wire-extender/raw/main/img/AzurePortalAppRegistration.jpg)](https://github.com/WIKA-Group/azureadb2c-spa-for-laravel-wire-extender/blob/main/img/AzurePortalAppRegistration.jpg)

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance83

Actively maintained with recent releases

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity37

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.

###  Release Activity

Cadence

Every ~26 days

Total

3

Last Release

87d ago

Major Versions

1.0.1 → 2.0.02026-04-09

### Community

Maintainers

![](https://www.gravatar.com/avatar/f7955eb510adaa883809d0df0ac4fa7e582f18fe9f6ea79463fc57a8b368bda0?d=identicon)[WIKA-Group](/maintainers/WIKA-Group)

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

---

Top Contributors

[![MasterZydra](https://avatars.githubusercontent.com/u/44842054?v=4)](https://github.com/MasterZydra "MasterZydra (6 commits)")

---

Tags

azureazureb2claravellivewirephpssosso-loginwire-extender

### Embed Badge

![Health badge](/badges/wika-group-azureadb2c-spa-for-laravel-wire-extender/health.svg)

```
[![Health](https://phpackages.com/badges/wika-group-azureadb2c-spa-for-laravel-wire-extender/health.svg)](https://phpackages.com/packages/wika-group-azureadb2c-spa-for-laravel-wire-extender)
```

###  Alternatives

[kartik-v/yii2-password

Useful password strength validation utilities for Yii Framework 2.0

761.3M17](/packages/kartik-v-yii2-password)[vitalybaev/laravel5-dkim

Laravel 5/6 package for signing outgoing messages with DKIM.

3163.1k](/packages/vitalybaev-laravel5-dkim)

PHPackages © 2026

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