Polaris for PHP · 0.11.0
One library, every framework.
Self-hosted authentication in your database, with one core and an adapter per framework: Laravel, Symfony, Yii and PSR-15, on PostgreSQL, MySQL and SQLite. Every adapter serves the same 52 endpoints with the same responses.
composer require polaris/laravel composer require polaris/symfony composer require polaris/yii composer require polaris/core polaris/psr15 polaris/pdo Laravel · 13
polaris/laravel
php artisan polaris:install && php artisan migrate, then Route::middleware('auth:polaris').
Symfony · 7.4 / 8
polaris/symfony
Register PolarisBundle, import the routes with type: polaris, put PolarisAuthenticator on a firewall.
Yii · 3
polaris/yii
A yiisoft/config plugin: set the polaris params, and the routes and the polaris/authentication middleware are there.
PSR-15 · Slim, Mezzio, any PSR-15 host
polaris/psr15
Polaris::create(new Config(...)), Pipeline::middleware(), Pipeline::handler().
Adapter matrix
Frameworks and databases
| Framework | Package | PostgreSQL | MySQL | SQLite |
|---|---|---|---|---|
| Laravel 13 | polaris/laravel | live | live | live |
| Symfony 7.4 / 8 | polaris/symfony | live | live | live |
| Yii 3 | polaris/yii | live | live | live |
| PSR-15 Slim, Mezzio, any PSR-15 host | polaris/psr15 | live | live | live |
| Univeros 2.6 | univeros/polaris | live | live | live |
For Univeros users
univeros/polaris 2.x is the same module
rebuilt on polaris/core; 2.4.0 runs every plugin
above by configuration, sends messages off the request through Univeros Messaging, writes its
section of the AgentSpec manifests, and adds bin/altair doctor
checks, the routes in routes:list, Observability metrics and
testing helpers. From 1.x it is a breaking major:
Univeros\Polaris\* classes become the
Polaris\* classes of the core, the database is not
migrated from 1.x, and TOTP factors are re-enrolled. 1.x
installations keep working on their own branch; upgrade when you can re-enrol MFA.
Read the upgrade guide ·
The Univeros module
Plugins
Add what your application needs.
16 Composer packages on the plugin contract, none of them part of core: each
brings its own tables, endpoints, permissions and problem types, works in every adapter, and
is released with the core at 0.11.0. On an installed database,
SchemaInstaller::createMissing() from
polaris/pdo adds the tables a new plugin needs. Coming from Better Auth?
Every Better Auth plugin, mapped.
Sign-in
Magic links, email one-time codes (sign-in, email verification, password reset), phone codes for a verified second contact, one-time tokens that hand a session to another device; each ends in core's login envelope behind core's MFA gate.
composer require polaris/passwordless Usernames unique without regard to case, and sign-in with a username or the email through core's password path.
composer require polaris/username Guest sessions, their conversion into the account the guest signs up for through a host hook, and the pruning of unconverted guests.
composer require polaris/anonymous Several signed-in accounts on one device, switching between them without signing in again, signing one out, the device's last sign-in method.
composer require polaris/multi-session OAuth 2.0 / OpenID Connect sign-in through Google, Apple, Microsoft, GitHub and fifteen more providers or any OAuth 2 server, account linking under a policy, Google One Tap, provider tokens on the user's behalf, an OAuth proxy for preview origins.
composer require polaris/social WebAuthn passkeys, registration and discoverable sign-in with conditional UI, each passkey also a core MFA factor verified through core's own MFA routes.
composer require polaris/passkey API access
API keys owned by users and organizations with a subset of the owner's permissions, their own rate limit, expiry, rotation with a grace window and revocation; a key authenticates every Polaris route as its owner.
composer require polaris/api-keys Polaris as an OAuth 2.1 / OpenID Connect provider; authorization code with PKCE, refresh rotation, client credentials, the device flow, CIBA, token exchange, DPoP, dynamic registration, client ID metadata documents, discovery; scopes are permissions.
composer require polaris/oauth-provider Agents
Polaris and the Model Context Protocol. McpProtectedResource protects any PHP MCP server with Polaris-issued tokens (RFC 9728 metadata, insufficient_scope step-up, DPoP, local keys or a remote issuer); Polaris itself is an MCP server whose tools are its routes and CLI commands, listed per principal, over POST /mcp and bin/polaris mcp.
composer require polaris/mcp AI agents as principals. Registration and host enrolment, delegated (token exchange with act) and autonomous (client credentials, private_key_jwt) agents, signed request JWTs, capability grants with constraints and budgets, approvals by device code, CIBA or in-app, signed receipt chains, a kill switch; Agent Auth Protocol compatible discovery.
composer require polaris/agents Enterprise
Per-organization SAML 2.0 and OpenID Connect providers, verified domains, just-in-time users and memberships, single logout in both directions, the organization's own self-service routes.
composer require polaris/sso A SCIM 2.0 server per organization; a directory provisions members and roles with a connection token the organization creates and rotates itself.
composer require polaris/scim Operations
The operator API over users, sessions, MFA, organizations, audit drains and statistics, for admin users and API keys, every action audited.
composer require polaris/admin Every Polaris event becomes a catalogued, redacted, append-only record, queried per user and per organization, streamed to sinks and to each organization's drains, pruned by policy, optionally hash-chained.
composer require polaris/audit The verification, reset, invitation, one-time-code and security messages from templates overridable per instance and per organization, translated, rate-limited, sent through the channel you choose (Symfony Mailer, PHPMailer, Twilio, Vonage, a log).
composer require polaris/messaging A local risk engine on sign-up, sign-in, password reset and code sends; signals score an attempt, a policy allows, challenges or blocks, observe mode records without enforcing.
composer require polaris/sentinel How it's proven
The same behaviour, replayed in CI.
- 52
- endpoints
- 184
- contract fixtures
- 1,201
- request/response steps
- 35
- events
The 184 contract fixtures, 1,201 request/response
steps recorded from Polaris 1.0, replay in CI through PSR-15, Laravel, Symfony and Yii, and so do
the plugins' 55. The
adapter conformance suite runs polaris/pdo on
PostgreSQL, MySQL and SQLite and polaris/testing on its
in-memory adapter. polaris/core imports no framework,
enforced in CI.