Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Gitlab Laravel Package

socialiteproviders/gitlab

GitLab OAuth provider for Laravel Socialite. Adds GitLab as an authentication driver for Socialite, letting users log in with their GitLab account and retrieve their profile. Install via Composer, add your GitLab client ID and secret, and configure the provider in your services config.

Deep Wiki
Context7

Socialite Providers GitLab adds GitLab OAuth 2.0 authentication to Laravel's Socialite package. It lets users sign in with their GitLab account and supports both gitlab.com and self-hosted GitLab instances through a configurable base URL.

  • Drop-in Socialite driver for GitLab
  • Works with self-hosted GitLab via custom domain
  • Configurable scopes (e.g. read_user, api)
  • Simple setup through services.php and the Socialite Providers listener
  • Returns a standard Socialite User object for easy retrieval of name, email, and nickname

Install with Composer, register the provider event listener, and authenticate as usual.

Frequently asked questions about Gitlab
How do I install socialiteproviders/gitlab in Laravel?
Run composer require socialiteproviders/gitlab, then register the SocialiteWasCalled listener for GitLabExtendSocialite unless your Laravel version auto-discovers it. Add your GitLab OAuth credentials to config/services.php and clear the config cache. Test the redirect and callback flow in a non-production environment before rollout.
Which Laravel, PHP, and Socialite versions does this GitLab provider support?
No current support matrix is provided in the package context, and the last release was on 2020-12-01. You must run a dependency-resolution spike against your target Laravel, PHP, and Socialite versions. Pin compatible versions and test the full OAuth handshake before committing to production.
Does this package support self-managed GitLab instances?
The provider is built for GitLab OAuth, but self-managed support depends on whether it exposes a configurable GitLab instance or base URL. GitLab.com is the common default target; for a self-managed instance, verify the provider config in source and test TLS, callback URLs, and certificate trust. Run a staging validation against your own GitLab instance before relying on it.
How do I configure the GitLab client ID, secret, and scopes?
Add gitlab credentials to config/services.php, including client_id, client_secret, redirect, and any required scopes. Keep secrets in environment variables and use separate GitLab OAuth applications per environment. After changing configuration, clear Laravel's config cache and confirm the callback URL exactly matches the GitLab application settings.
How do I register the Socialite provider listener in Laravel?
Add a listener for SocialiteProviders\Manager\SocialiteWasCalled that calls GitLabExtendSocialite, typically in EventServiceProvider. Some package versions may rely on auto-discovery, so verify your installed version's registration requirements. Once registered, Socialite::driver('gitlab') should resolve the GitLab provider.
What routes and callback URL do I need for GitLab login?
Create routes for redirect and callback, such as /auth/gitlab/redirect and /auth/gitlab/callback, and set the callback URL in your GitLab OAuth application to match each environment. The redirect route calls Socialite::driver('gitlab')->redirect(), and the callback route calls ->user(). Log callback and token-exchange failures without leaking client secrets or tokens.
How do I map the returned GitLab user to a local Laravel user?
Socialite returns a user object with the GitLab ID, nickname, name, email, and avatar. Match existing accounts by stored provider ID first; only link by email when the email is verified and your account-linking policy allows it. Store the GitLab provider ID in a social accounts table and avoid unsafe auto-linking on unverified email.
Does this package support PKCE, state validation, refresh tokens, or private email?
State handling is generally part of Socialite's OAuth flow, but PKCE and refresh-token support are not guaranteed by this thin GitLab adapter. Private-email behavior depends on requested scopes and the user's GitLab settings, so handle a missing email explicitly. Verify all of these in the provider source and upstream SocialiteProviders repository before relying on them.
Is socialiteproviders/gitlab actively maintained and safe for production?
Treat it as community-supported with no SLA: the last release was 2020-12-01 and the repository is a read-only subtree split of SocialiteProviders/Providers. Track upstream activity and be prepared to pin, fork, or use a Composer VCS override for urgent patches. Run a compatibility and security spike before production adoption.
What are alternatives if this package is outdated or unsupported?
Consider using the upstream SocialiteProviders/Providers monorepo directly, a maintained fork, or a custom Laravel Socialite provider. For OpenID Connect scenarios, evaluate a generic OIDC client instead. You can also pin this package and patch it through a Composer VCS override while tracking upstream fixes.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect
youbar/easy-crud
c-point-labs/laravel-hostyourai
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo