socialiteproviders/shopify
Shopify OAuth provider for Laravel Socialite. Lets Laravel apps authenticate users through Shopify using the standard Socialite flow, with a dedicated provider and driver for shop domain handling. Install via Composer, then configure credentials and scopes.
composer require socialiteproviders/<provider> (e.g. socialiteproviders/github, socialiteproviders/steam). Composer will pull in socialiteproviders/manager automatically — that's the shared glue package.SocialiteWasCalled event. On Laravel 10 and earlier add it to EventServiceProvider::$listen; on Laravel 11/12 use bootstrap/app.php:
// Laravel 11+
->withEvents(discover: [
\SocialiteProviders\Manager\SocialiteWasCalled::class => [
\SocialiteProviders\Steam\SteamExtendSocialite::class.'@handle',
],
])
config/services.php — the array key must match the driver string you pass to Socialite::driver():
'steam' => [
'client_id' => env('STEAM_CLIENT_ID'),
'client_secret' => env('STEAM_CLIENT_SECRET'),
'redirect' => env('STEAM_REDIRECT_URI'),
],
Route::get('/auth/redirect', fn () => Socialite::driver('steam')->redirect());
Route::get('/auth/callback', function () {
$user = Socialite::driver('steam')->user();
// $user->getId(), ->getName(), ->getEmail(), ->getAvatar()
});
SocialiteProviders/Providers (each provider folder has one), then the *ExtendSocialite class for the driver name it registers, then config/services.php.steam vs steamopenid, twitch vs twitch_helix). Always confirm from the provider's ServiceProvider/ExtendSocialite file rather than assuming.Socialite::driver('x')->stateless()->user() in the callback, paired with stateless()->redirect() on the redirect leg. Requires you to handle state yourself if you care about CSRF.->scopes([...]) (merges with provider defaults) over ->with(['scope' => ...]) (overrides). Provider-specific extras go through ->with([...]), e.g. Google's access_type/prompt, or ->setScopes() on the driver instance.$user = Socialite::driver('x')->user(); $user->refreshToken; $user->expiresIn; then Socialite::driver('x')->refreshToken($token)->user() (provider support varies). Persist refreshToken encrypted if you store it.config/services.php, you can register per-tenant config at runtime (config(['services.github.client_id' => ...])) before calling Socialite::driver() — cleaner than duplicating drivers.SocialiteUser ID plus provider name as a composite key in an oauth_accounts table; keep email matching as a fallback with an explicit "verified email only" guard.socialiteproviders/manager directly and extend SocialiteProviders\Manager\OAuth2\AbstractProvider (and User) to write your own provider while reusing the event-listener wiring.Http::fake()) or swap the Socialite driver with a mock returning a real SocialiteUser; don't hit live OAuth endpoints in CI. Assert on your callback route, not on the package.invalid_client / redirect_uri_mismatch failures come from a trailing slash or http vs https difference between services.php and the provider console. Match byte-for-byte.Socialite::driver('steam') throws InvalidArgumentException, the SocialiteWasCalled listener isn't wired. On Laravel 11+ with event discovery, cached events (php artisan event:cache) can also hide newly registered listeners — clear it.php artisan config:cache after editing services.php. In production deploys, stale config is the usual suspect for "wrong client id" after a credential rotation.manager, not your app. 4.3.0 swapped the deprecated Request::get() for input() inside the manager package's request handling (atymic, PR #1462). This is a drop-in patch — no API change, no config change, no breaking behaviour. Upgrade with composer update socialiteproviders/manager and you'll stop seeing the PHP 8.x/Laravel 11+ deprecation noise in logs. Nothing else to do.socialiteproviders/manager if you use many providers. Old provider packages sometimes constrain manager to a narrow range, so adding a second provider can conflict. composer why socialiteproviders/manager diagnoses it.getEmail() returns anything (Google, Microsoft) — a null email is often config, not a bug.->user() in a try/catch for \Laravel\Socialite\Two\InvalidStateException (user denied / session expired) and redirect to a friendly error page rather than a 500.api middleware will silently break state checks.Socialite::driver('x')->getAuthUrl() (or dd'ing the redirect Location header) exposes exactly what scopes/params were sent — faster than reading the provider source.getUserByToken() in a subclassed provider when the provider's user payload needs normalising (nested data envelopes are common), and bind your subclass rather than patching vendor code.How can I help you explore Laravel packages today?