thenetworg/oauth2-azure
Azure Active Directory OAuth 2.0 provider for the PHP League's OAuth client. Adds Azure AD and Microsoft Graph support, authorization code flow, on-behalf-of tokens, logout, B2C, and certificate-based auth.
getTenantId(), getUpn(), getId(), and arbitrary claims via claim($name). That is enough to decide whether you map a login to an organization, drive invitation/provisioning flows, and support customer-owned tenants — a product decision, not just an auth detail.get/post/put/patch/delete plus getObjects() (which follows odata.nextLink automatically) means Graph-backed features — calendar sync, mail-to-ticket, OneDrive attachments, directory/seat reconciliation — are incremental scope, not a new integration project.validateAccessToken() for inbound bearer tokens and the jwt_bearer / on-behalf-of grant let you standardize on "one identity across products and services," which affects whether you offer a public API and how you price platform access.getLogoutUrl() means you can credibly ship "sign out everywhere."resource-vs-scope differences matter if any accounts in the field still run older Azure AD app registrations.Adopt it when:
Look elsewhere, or proceed with explicit caveats, when:
composer require.For executives: This closes the "does it work with Microsoft?" objection that stalls deals in customer IT review. Instead of a multi-week OAuth build, it's roughly a day of integration behind our existing login, at zero license cost, with no new vendor and no lock-in — the code is MIT and we can replace it. It also unlocks the Microsoft-connected features (calendar, mail, files, directory) that upsell existing accounts. The ask is approval of the integration layer for [feature], with two guardrails: we don't build on the library's experimental features, and we keep our own thin wrapper so switching later is contained.
For engineering: It's a provider implementation for the League OAuth2 Client — we supply credentials, get tokens and claims, and call Graph. It gives us certificate auth, token validation for our own API, on-behalf-of grants, and logout URL generation for free. The trade-offs are real: community-maintained, small dependent base, and the B2C/API-protection/refresh-token features are marked experimental. Mitigation is straightforward — pin the version, wrap it in our own auth service, and test the claim-to-user mapping so a future swap is a one-file change rather than an auth rewrite.
Decision requested: Approve as the Azure AD integration layer for the stated scope, with ownership assigned to the platform team and an explicit rule that experimental APIs are not used in production paths.
How can I help you explore Laravel packages today?