naf / oauth-client
Sign in with external OAuth2 and OpenID Connect providers, keeping your own user model.
Requires
- php: >=8.3
- ext-json: *
- ext-openssl: *
- firebase/php-jwt: ^7.1
- naf/auth: ^0.2
- naf/framework: ^0.2
- naf/session: ^0.2
- nyholm/psr7: ^1.8
- psr/http-client: ^1.0
- psr/http-message: ^2.0
Requires (Dev)
- naf/cli: ^0.2
- naf/client: ^0.2
- naf/database: ^0.2
- naf/view: ^0.2
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^12.1
Suggests
- ext-sodium: Encrypt stored provider tokens, when oauth:tokens:store is on.
- naf/cli: Resolve provider endpoints once with oauth:discover.
- naf/client: A PSR-18 client for the token exchange, unless you bind your own.
- naf/database: Ship the account-link table as a migration.
- naf/view: Override the shipped login button by shadowing its view.
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-13 20:55:23 UTC
README
naf/oauth-client
Sign people in with Google, Microsoft or any OpenID Connect provider — and keep your own user model.
<?= oauth_button('google') ?>
That is the whole integration. The routes, the protocol and the account lookup are already wired; what is left for you is the one decision nobody else can make — see Which account is this?
🧩 Part of the official NAF plugin collection. Install it when people should sign in with an account they already have.
Documentation
Everything about this package — what it does, how it is configured and what it needs — lives in the NAF documentation. Not sure which packages you need? Start here.
Install
composer require naf/oauth-client
License
MIT. Part of NAF.
