Weave 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

Passport Multiauth Laravel Package

smartins/passport-multiauth

Extends Laravel Passport to support multiple authenticatable models and guards, such as users and admins, in one app. Map OAuth clients to guards, issue and validate tokens per provider, and keep authentication flows isolated without separate Passport installations.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Multi-persona authentication as a first-class capability. Laravel Passport ships with a single global user provider — one token table assumption, one User model. This package makes the OAuth guard/provider pair the unit of identity, so an app can issue and validate tokens for admins, customers, drivers, or partners independently. That unlocks a product decision most SaaS roadmaps eventually hit: do we model these as roles on one user table, or as genuinely separate identity domains?
  • Build vs. buy for auth plumbing. The alternative to adopting this is 3–6 weeks of engineering to swap Passport's TokenRepository, ClientRepository, and personal-access-token factory for guard-aware versions — subtle, security-adjacent work with a long tail of edge cases (token refresh, revocation, scope leakage across guards). At 283 stars and MIT licensing, this is a cheap way to defer that spend and validate demand before committing.
  • Roadmap sequencing for B2B / marketplace expansion. If the next two quarters include a partner portal, a seller console, or a separate mobile app for a different user class, this is the enabler. It lets the team ship a second identity surface without a parallel auth stack or an SSO migration.
  • Segmentation and compliance posture. Separate providers give separate audit trails, separate token lifetimes, and cleaner blast radius — a customer token can't resolve to an admin principal by construction. That is a real answer to "how do you segregate privileged access?" in security reviews, not just a code convenience.
  • Data-model decisions with downstream cost. Adopting this effectively ratifies "multiple user tables" over "one table plus a role column." That choice ripples into reporting, support tooling, and admin search. Making it explicitly here is cheaper than discovering it during a migration.
  • Prioritization of auth work against everything else. A concrete, low-effort option raises the cost of not doing multi-persona auth this quarter, and gives you a defensible "we'll defer the identity refactor" line item with a named interim solution.

When to Consider This Package

Consider it when:

  • You are on Laravel ≤ 8 with Passport ≤ 9 (roughly the 2019–2020 dependency window this package was built and last released against) and have a working Passport implementation you are extending, not replacing.
  • You already maintain separate user tables — or have a firm product reason to — for distinct actor types that log in differently, have different profile schemas, and different lifecycles.
  • The distinct identities need independent OAuth clients (first-party mobile app vs. partner integration) with client-scoped tokens.
  • You can vendor the source or fork it and accept ownership of a ~1–2k line patch to Passport internals, including the upgrade tax on every Passport major.
  • You are time-boxing a validation — a pilot, a design partner, a market test — where proving the multi-persona model matters more than long-term dependency hygiene.

Look elsewhere when:

  • You are on Laravel 9/10/11/12 or Passport 11+. The last release was April 2020 and it has zero dependents in the ecosystem; it patches Passport's internals, so an unmaintained fork means you own the merge conflict on every Passport bump. A single GitHub-issue triage cycle should settle this before you write a line of code.
  • A single users table with roles/permissions (Spatie, Bouncer, or Gates) actually models your domain. Multi-guard auth is a heavier hammer than most RBAC problems need, and it complicates joins and admin tooling permanently.
  • Laravel Sanctum covers the requirement. If you don't need full OAuth2 authorization-code flow, client credentials, or third-party app consent, Sanctum is first-party, maintained, and simpler — this is usually the correct default for SPA + mobile first-party auth.
  • You actually need a real identity provider — SSO/SAML, SCIM provisioning, MFA, social federation, per-tenant IdPs. That's Auth0, Keycloak, Cognito, or WorkOS, and no Laravel package substitutes for it. Decide this before adopting anything.
  • The identity boundary is a security or compliance requirement with an audit obligation. Betting that on a 2020-era unmaintained dependency is a decision your security reviewer will push back on, correctly.

How to Pitch It (Stakeholders)

For executives — one paragraph: We need to serve a second class of user (partners / sellers / field staff) with their own login and their own tokens. Today our auth stack assumes one kind of user, and retrofitting it properly is several weeks of security-sensitive engineering. An open-source MIT-licensed package exists that closes most of that gap for roughly a day or two of integration. I recommend we use it as a bridge to validate demand this quarter, with an explicit ticket to replace or formally adopt it — not as a permanent foundation. The risk is not cost, it's staleness: the package hasn't been updated since 2020, so we should plan to own it.

For engineering — the ask: Spike it for two days against our current Passport version. If it installs cleanly and the guard-aware token flow passes our existing auth test suite plus three new cases (cross-guard token rejection, refresh under a non-default guard, revocation isolation), vendor it into the repo and treat it as our code. If the Passport version mismatch requires patching internals ourselves, we stop and re-scope — the build estimate stands at 3–6 weeks and we'd rather spend that deliberately than by accident.

The honest framing: This is a good decision for deferring cost and a bad decision for avoiding it. It buys us a quarter of validated learning on a new user segment at roughly 5% of the build cost — provided we accept that the dependency is frozen in time and budget the ownership accordingly. The signal to watch is simple: if the spike requires us to modify Passport internals ourselves, the package has already stopped paying for itself.

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.
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator
equipc/laravel-email-database-log
adedsec/nova-translated-labels
wazza/laravel-db-encryption
hokny/laravel-generator
vonsogt/backup
jengo/queues
jeremykenedy/laravel-observability
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums