Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Oauth2 Microsoft Openid

Oauth2 Microsoft Openid Laravel Package

alancting/oauth2-microsoft-openid

View on GitHub
Deep Wiki
Context7

Microsoft OAuth 2.0 support for the PHP League's OAuth 2.0 Client

Frequently asked questions about Oauth2 Microsoft Openid
Can I use this package directly in Laravel without Symfony?
No, this package is Symfony-centric and relies on Symfony’s DependencyInjection and Security components. You’ll need to create Laravel-compatible adapters (e.g., wrapping Symfony’s UserProvider or GuardAuthenticator) or use Laravel’s Socialite for a native solution.
Does this package support Azure AD and ADFS in Laravel?
Yes, but only if you build a custom adapter layer to bridge Symfony’s components with Laravel’s Auth system. The package itself supports both Azure AD and ADFS, but integration requires manual effort to align with Laravel’s ecosystem.
What Laravel versions does this package officially support?
This package has no official Laravel support—it was last updated in 2020 for PHP 7.1+. For Laravel 10+, you’d need to fork and update dependencies manually, which introduces compatibility risks. Consider alternatives like Socialite for modern Laravel.
How do I handle token storage in Laravel with this package?
The package stores tokens via Symfony’s UserProvider, but you can replace this with Laravel’s Session or Cache (e.g., using `session()->put()` or a dedicated `oauth_tokens` table). Custom middleware or services can sync tokens between Symfony’s and Laravel’s storage.
Is there a simpler alternative for Microsoft OAuth in Laravel?
Yes, **socialiteproviders/microsoft** is a more mature, Laravel-native option that integrates seamlessly with Laravel’s Socialite. It lacks ADFS-specific features but covers Azure AD well and is actively maintained.
Can I use this package for JWT validation in Laravel?
The package includes **alancting/php-microsoft-jwt** for JWT validation, which can be used standalone in Laravel. However, you’d need to manually integrate it with Laravel’s Auth system or Passport, as the package itself isn’t Laravel-compatible.
What’s the best way to implement logout with Microsoft in Laravel?
Microsoft’s logout endpoint can be triggered via Laravel routes or middleware. Use the package’s Adfs/Azure AD client to generate logout URLs, then redirect users. Store the logout URL in your config and handle it with Laravel’s `Redirect` facade or a custom middleware.
Will this package work with Laravel’s Passport for OAuth2?
No, this package isn’t designed for Passport. Passport is Laravel’s OAuth2 server library, while this package is an OAuth2 client for Microsoft. For Passport integration, use **socialiteproviders/microsoft** or manually bridge the package’s client with Passport’s token handling.
How do I test this package in a Laravel environment?
Start by creating a proof-of-concept: wrap Symfony’s `GuardAuthenticator` in Laravel middleware and test the OAuth flow with Postman or Laravel Telescope. Mock the `UserProvider` to return a Laravel `Authenticatable` model and validate token responses.
What are the risks of using this outdated package in production?
The package’s last update was in 2020, with no PHP 8.x or Laravel 10+ support. Risks include dependency conflicts, security vulnerabilities, and lack of long-term maintenance. Evaluate whether its ADFS-specific features justify the integration effort over alternatives like Socialite.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
comsave/common
alecsammon/php-raml-parser
chrome-php/wrench
lendable/composer-license-checker
typhoon/reflection
mesilov/moneyphp-percentage
mike42/gfx-php
bookdown/themes
aura/view
aura/html
aura/cli
povils/phpmnd
nayjest/manipulator
omnipay/tests
psr-mock/http-message-implementation
psr-mock/http-factory-implementation
psr-mock/http-client-implementation
voku/email-check
voku/urlify
rtheunissen/guzzle-log-middleware