Download the PHP package gusmanwidodo/auth-kit-social without Composer
On this page you can find all versions of the php package gusmanwidodo/auth-kit-social. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download gusmanwidodo/auth-kit-social
More information about gusmanwidodo/auth-kit-social
Files in gusmanwidodo/auth-kit-social
Package auth-kit-social
Short Description Social / OAuth login plugin for Auth-Kit, built as a thin wrapper over Laravel Socialite. Stores linked social identities (multi-provider), with redirect/callback endpoints and login hooks.
License MIT
Homepage https://github.com/gusmanwidodo/auth-kit-social
Informations about the package auth-kit-social
Auth-Kit Social
Social / OAuth login plugin for Auth-Kit, built as a thin wrapper over Laravel Socialite. It stores linked social identities (multi-provider per user, tokens encrypted at rest), adds redirect/callback/link/unlink endpoints, and runs login hooks — while delegating the entire OAuth handshake to Socialite.
Socialite compatibility
Socialite does the OAuth handshake and returns a normalized user; it does not persist anything or link identities to your users. This plugin fills exactly that gap without reimplementing OAuth, so it stays compatible with every Socialite driver — including the community adapters from socialiteproviders.com.
- Redirect delegates to
Socialite::driver($provider)->redirect(). - Callback pulls
Socialite::driver($provider)->user(), then links/stores. - Tests use
Socialite::fake()— no real OAuth round-trip.
See ADR 005 for the design rationale.
Requirements
- PHP
^8.3 gusmanwidodo/auth-kit^0.1laravel/socialite^5.0- Laravel 12
Installation
Configure your OAuth apps in config/services.php as you normally would for
Socialite, then enable the providers in config/auth-kit-social.php:
Endpoints
| Method | URI | Purpose |
|---|---|---|
| GET | /auth-kit/social/{provider}/redirect |
Redirect to the OAuth provider (via Socialite) |
| GET | /auth-kit/social/{provider}/callback |
Handle the callback: link/store identity, run hooks |
| POST | /auth-kit/social/{provider}/link |
Link a provider to an existing subject |
| POST | /auth-kit/social/{provider}/unlink |
Unlink a provider from a subject |
Providers not listed in config return 404 so a URL typo can't reach an
unconfigured driver.
How login works
The plugin owns linking, not user creation — matching Socialite's own
guidance (your app decides how a user is provisioned). On a new login, the
before:social.login hook must resolve the subject (find-or-create your user):
On a returning login (an identity already exists for (provider, provider_id)), the subject is resolved automatically and the stored profile +
tokens are refreshed — no hook needed.
Programmatic API
Multi-provider & encrypted tokens
- A subject may hold multiple identities (one per provider);
(provider, provider_id)is unique so the same OAuth account can't be linked twice. - OAuth
tokenandrefresh_tokenare stored encrypted at rest (Laravelencryptedcast). A test asserts the DB ciphertext differs from the plaintext.
Hooks
| Event | When | Payload |
|---|---|---|
before:social.login |
New identity, before creation | provider, provider_id, email, name, nickname → set subject_type/subject_id or veto with allow=false |
after:social.login |
After link/login | provider, identity_id, subject_type, subject_id, new |
Developing against a local core
Note: running
composer require :@devrewrites this composer.json to@dev. Revert thegusmanwidodo/auth-kitconstraint to^0.1(and remove anyrepositoriesblock) before committing/tagging a release.
License
MIT © Gusman Widodo. See LICENSE.
All versions of auth-kit-social with dependencies
gusmanwidodo/auth-kit Version ^0.1
illuminate/contracts Version ^12.0
illuminate/database Version ^12.0
illuminate/support Version ^12.0
laravel/socialite Version ^5.0