Install the package:
> composer require wika-group/azureadb2c-spa-for-laravel
Publish assets:
> php artisan vendor:publish --tag=azureb2cspa-assets
Extend .env and configure:
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'
@azureB2cSpaScripts()
If you use it with Livewire or Wire Extender, you must add @assets
:
@assets
@azureB2cSpaScripts()
@endassets
<button onClick="b2cPopupLogin()">Login with Azure B2C</button>