agentleFS
syofyanzuhadsyofyanzuhad/uptime-kita/.agents/skills/socialite-development/SKILL.md

socialite-development

Skill184 starsChanged 2 months agoApache-2.0View on GitHub

Manages OAuth social authentication with Laravel Socialite. Activate when adding social login providers; configuring OAuth redirect/callback flows; retrieving authenticated user details; customizing scopes or parameters; setting up community providers; testing with Socialite fakes; or when the user mentions social login, OAuth, Socialite, or third-party authentication.

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 1 is distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use search-docs for detailed Socialite patterns and documentation (installation, configuration, routing, callbacks, testing, scopes, …

    line 13
  2. Distinctive:

    Must register via event listener — NOT auto-discovered like built-in providers

    line 27
  3. Very specific:

    Use search-docs for the registration pattern

    line 28
  4. Very specific:

    Add the provider's client_id, client_secret, and redirect to config/services.php.

    line 34
  5. Very specific:

    Use search-docs for complete code examples of each step.

    line 59
  6. Very specific:

    Use search-docs for usage details on: enablePKCE(), userFromToken($token), userFromTokenAndSecret($token, $secret) (OAuth 1.0), retrieving …

    line 63
  7. Very specific:

    Every provider needs client_id, client_secret, and redirect in config/services.php.

    line 74
  8. Very specific:

    Do not pass state, response_type, client_id, redirect_uri, or scope via with() — these are reserved.

    line 78

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Socialite Authentication

Documentation

Use search-docs for detailed Socialite patterns and documentation (installation, configuration, routing, callbacks, testing, scopes, stateless auth).

Available Providers

Built-in: facebook, twitter, twitter-oauth-2, linkedin, linkedin-openid, google, github, gitlab, bitbucket, slack, slack-openid, twitch

Community: 150+ additional providers at socialiteproviders.com. For provider-specific setup, use WebFetch on https://socialiteproviders.com/{provider-name}.

Configuration key in config/services.php must match the driver name exactly — note the hyphenated keys: twitter-oauth-2, linkedin-openid, slack-openid.

Twitter/X: Use twitter-oauth-2 (OAuth 2.0) for new projects. The legacy twitter driver is OAuth 1.0. Driver names remain unchanged despite the platform rebrand.

Community providers differ from built-in providers in the following ways:

  • Installed via composer require socialiteproviders/{name}
  • Must register via event listener — NOT auto-discovered like built-in providers
  • Use search-docs for the registration pattern

Adding a Provider

1. Configure the provider

Add the provider's client_id, client_secret, and redirect to config/services.php. The config key must match the driver name exactly.

2. Create redirect and callback routes

Two routes are needed: one that calls Socialite::driver('provider')->redirect() to send the user to the OAuth provider, and one that calls Socialite::driver('provider')->user() to receive the callback and retrieve user details.

3. Authenticate and store the user

In the callback, use updateOrCreate to find or create a user record from the provider's response (id, name, email, token, refreshToken), then call Auth::login().

4. Customize the redirect (optional)

  • scopes() — merge additional scopes with the provider's defaults
  • setScopes() — replace all scopes entirely
  • with() — pass optional parameters (e.g., ['hd' => 'example.com'] for Google)
  • asBotUser() — Slack only; generates a bot token (xoxb-) instead of a user token (xoxp-). Must be called before both redirect() and user(). Only the token property will be hydrated on the user object.
  • stateless() — for API/SPA contexts where session state is not maintained

5. Verify

  1. Config key matches driver name exactly (check the list above for hyphenated names)
  2. client_id, client_secret, and redirect are all present
  3. Redirect URL matches what is registered in the provider's OAuth dashboard
  4. Callback route handles denied grants (when user declines authorization)

Use search-docs for complete code examples of each step.

Additional Features

Use search-docs for usage details on: enablePKCE(), userFromToken($token), userFromTokenAndSecret($token, $secret) (OAuth 1.0), retrieving user details.

User object: getId(), getName(), getEmail(), getAvatar(), getNickname(), token, refreshToken, expiresIn, approvedScopes

Testing

Socialite provides Socialite::fake() for testing redirects and callbacks. Use search-docs for faking redirects, callback user data, custom token properties, and assertion methods.

Common Pitfalls

  • Config key must match driver name exactly — hyphenated drivers need hyphenated keys (linkedin-openid, slack-openid, twitter-oauth-2). Mismatch silently fails.
  • Every provider needs client_id, client_secret, and redirect in config/services.php. Missing any one causes cryptic errors.
  • scopes() merges with defaults; setScopes() replaces all scopes entirely.
  • Missing stateless() in API/SPA contexts causes InvalidStateException.
  • Redirect URL in config/services.php must exactly match the provider's OAuth dashboard (including trailing slashes and protocol).
  • Do not pass state, response_type, client_id, redirect_uri, or scope via with() — these are reserved.
  • Community providers require event listener registration via SocialiteWasCalled.
  • user() throws when the user declines authorization. Always handle denied grants.

Download now (ZIP)

  • Other versions9 projects use a version of this.

    Word for word · 9

    1. coollabsio/coolify★ 65k100% same
    2. relaticle/relaticle★ 1.8k100% same
    3. Relaticle/relaticle★ 1.8k100% same
    4. nasirkhan/laravel-starter★ 1.4k100% same
    5. m3ue/m3u-editor★ 870100% same
    6. sparkison/m3u-editor★ 870100% same
    7. trypostit/trypost★ 792100% same
    8. owlchester/kanka★ 358100% same
    9. sbarbat/tentaclesauth★ 0100% same

    Edited · 0

    None found.

    Wrote their own version · 0

    None found.

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • Used alongsideProjects with it also use ai-sdk-development, medialibrary-development and 3 more.

    Other files people use alongside this one.

    Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
    • m3ueSkill

      ai-sdk-development

      TRIGGER when working with ai-sdk which is Laravel official first-party AI SDK. Activate when building, editing AI agents, chatbots, text generation, image generation, audio/TTS, transcription/STT, embeddings, RAG, vector stores, reranking, structured output, streaming, conversation memory, tools, queueing, broadcasting, and provider failover across OpenAI, Anthropic, Gemini, Azure, Groq, xAI, DeepSeek, Mistral, Ollama, ElevenLabs, Cohere, Jina, and VoyageAI. Invoke when the user references ai-sdk, the `Laravel\Ai\` namespace, or this project's AI features — not for Prism PHP or other AI packages used directly.

      Also in 5 projects that use this

    • gdarkoSkill

      medialibrary-development

      Build and work with spatie/laravel-medialibrary features including associating files with Eloquent models, defining media collections and conversions, generating responsive images, and retrieving media URLs and paths.

      Also in 3 projects that use this

    • gdarkoSkill

      fortify-development

      ACTIVATE when the user works on authentication in Laravel. This includes login, registration, password reset, email verification, two-factor authentication (2FA/TOTP/QR codes/recovery codes), profile updates, password confirmation, or any auth-related routes and controllers. Activate when the user mentions Fortify, auth, authentication, login, register, signup, forgot password, verify email, 2FA, or references app/Actions/Fortify/, CreateNewUser, UpdateUserProfileInformation, FortifyServiceProvider, config/fortify.php, or auth guards. Fortify is the frontend-agnostic authentication backend for Laravel that registers all auth routes and controllers. Also activate when building SPA or headless authentication, customizing login redirects, overriding response contracts like LoginResponse, or configuring login throttling. Do NOT activate for Laravel Passport (OAuth2 API tokens), Socialite (OAuth social login), or non-auth Laravel features.

      Also in 4 projects that use this

    • whisper-moneySkill

      cashier-stripe-development

      Handles Laravel Cashier Stripe integration including subscriptions, webhooks, Stripe Checkout, invoices, charges, refunds, trials, coupons, metered billing, and payment failure handling. Triggered when a user mentions Cashier, Billable, IncompletePayment, stripe_id, newSubscription, Stripe subscriptions, or billing. Also applies when setting up webhooks, handling SCA/3DS payment failures, testing with Stripe test cards, or troubleshooting incomplete subscriptions, CSRF webhook errors, or migration publish issues.

      Also in 3 projects that use this

    • StacklokLabsSkill

      mcp-development

      Guide for developing MCP servers with Python SDK. Use when implementing MCP tools, resources, or prompts.

      Also in 5 projects that use this

  • In this repository33 other files it gives its agents.

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.