Microsoft

socialiteproviders/microsoft image

Microsoft stats

Downloads
1.1M
Stars
17
Open Issues
1
Forks
11

View on GitHub →

Microsoft OAuth2 Provider for Laravel Socialite

Microsoft Socialite Provider for Laravel

The socialiteproviders/microsoft package allows Laravel applications to authenticate users via the Microsoft OAuth service, integrating seamlessly with Laravel's Socialite package. This provider simplifies Microsoft OAuth implementation, making it straightforward to add Microsoft login to your web applications.

Key Features:

  • Simple Configuration: Add Microsoft as an OAuth provider by updating the config/services.php file with your Microsoft client credentials.
  • Event Listener Setup: Incorporate the Microsoft provider by adding an event listener to SocialiteWasCalled events in your EventServiceProvider.
  • Tenant Information: Optionally retrieve tenant details along with user authentication, useful for applications needing tenant-specific data.

Installation:

Install the package via Composer:

composer require socialiteproviders/microsoft

Configuration:

  1. Add to config/services.php:

    'microsoft' => [
    'client_id' => env('MICROSOFT_CLIENT_ID'),
    'client_secret' => env('MICROSOFT_CLIENT_SECRET'),
    'redirect' => env('MICROSOFT_REDIRECT_URI')
    ],
  2. Modify app/Providers/EventServiceProvider:

    protected $listen = [
    \SocialiteProviders\Manager\SocialiteWasCalled::class => [
    \SocialiteProviders\Microsoft\MicrosoftExtendSocialite::class.'@handle',
    ],
    ];

Usage:

Utilize the Microsoft driver as you would any Socialite provider:

return Socialite::driver('microsoft')->redirect();

Extended Features:

  • Include Tenant Information: To include tenant data, set 'include_tenant_info' => true in your Microsoft configuration and specify the tenant ID. This returns additional fields such as ID, displayName, and verifiedDomains.

Refer to the Base Installation Guide for detailed setup and usage instructions.

This package extends Laravel’s capabilities, making it easier to implement secure and reliable authentication with Microsoft services.

SocialiteProviders photo

Socialite Providers for Laravel

Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.


Socialiteproviders Microsoft Related Articles

Bartender Is an Opinionated Way to Authenticate Users Using Laravel Socialite image

Bartender Is an Opinionated Way to Authenticate Users Using Laravel Socialite

Read article
SaaSykit: Laravel SaaS Starter Kit logo

SaaSykit: Laravel SaaS Starter Kit

SaaSykit is a Multi-tenant Laravel SaaS Starter Kit that comes with all features required to run a modern SaaS. Payments, Beautiful Checkout, Admin Panel, User dashboard, Auth, Ready Components, Stats, Blog, Docs and more.

SaaSykit: Laravel SaaS Starter Kit
LoadForge logo

LoadForge

Scalable load testing for web apps & APIs. Simulate real-world traffic and identify breaking points and performance limits with powerful, scalable load tests designed for Laravel.

LoadForge
PhpStorm logo

PhpStorm

The go-to PHP IDE with extensive out-of-the-box support for Laravel and its ecosystem.

PhpStorm
Laravel Cloud logo

Laravel Cloud

Easily create and manage your servers and deploy your Laravel applications in seconds.

Laravel Cloud
DreamzTech logo

DreamzTech

Hire 6-10+ Yrs. experienced skilled Laravel Developers from DreamzTech. We ensure NDA protected, 100% quality delivery. Contact Us & Discuss Your Need.

DreamzTech
No Compromises logo

No Compromises

Joel and Aaron, the two seasoned devs from the No Compromises podcast, are now available to hire for your Laravel project. ⬧ Flat rate of $9500/mo. ⬧ No lengthy sales process. ⬧ No contracts. ⬧ 100% money back guarantee.

No Compromises