- How do I install and set up socialiteproviders/qq in a Laravel app?
- Install it with composer require socialiteproviders/qq, then register the SocialiteProviders\Manager\SocialiteWasCalled event listener so the QQ driver is added to Socialite. Add your QQ互联 client ID, secret, and redirect URI to config/services.php under the qq key. After that, Socialite::driver('qq')->redirect() and the callback's ->user() call work like any other Socialite provider.
- Does socialiteproviders/qq support Laravel 10, 11, and 12?
- Not guaranteed. The last tagged release was 2022-07-25, and because this is a read-only subtree split of the SocialiteProviders/Providers monorepo, its illuminate/support constraint is likely pinned to older majors such as ^6 through ^9. Composer may refuse to resolve on Laravel 10 or newer unless you use --with-all-dependencies gymnastics, pull the upstream main branch, or fork the package. Verify with a quick spike before committing to the integration.
- How do I configure the QQ driver credentials and callback URL?
- Add a qq entry in config/services.php with client_id, client_secret, and redirect keys, matching the app you registered in the QQ互联 developer console. The redirect value must exactly match the callback domain you registered, which for mainland China apps typically requires an ICP-filed domain and an approved business entity. Review and approval by Tencent can take days to weeks and sits outside your engineering team's control.
- What does Socialite::driver('qq')->user() return for a QQ account?
- It returns the standard Laravel\Socialite\Two\User object. getId() gives you the QQ openid, and getName() and getNickname() expose the nickname, with getAvatar() pointing at a qlogo.cn URL. The raw get_user_info payload, including gender, province, city, and year, is available through getUser().
- Does the QQ provider return an email address I can use for account matching?
- No. Tencent QQ's user/get_user_info endpoint returns nickname, avatar, gender, province, city, and year, but never an email address. That rules out email-based account deduplication, password recovery, and cross-provider matching by email. Your identity model must key on openid, and ideally unionid, rather than an email column.
- What is the difference between openid and unionid for QQ login?
- openid is scoped to a single QQ互联 application, so a second app or tenant gets a different identifier for the same person. unionid is scoped to the developer account and stays stable across all apps under it. If you might ever run more than one app or migrate later, enable unionid at registration time, because retrofitting it after launch is painful.
- Why does Composer fail to resolve socialiteproviders/qq for my project?
- The split repository's tags are generated from the upstream monorepo, and no new release has appeared since July 2022, so its illuminate/support requirement likely conflicts with current Laravel and PHP versions. Try composer require socialiteproviders/qq --with-all-dependencies to see the actual conflict message, then test whether the upstream Providers monorepo main branch resolves. If neither works, a small fork with a widened version constraint is often the cheapest fix.
- How should I handle QQ Graph API errors that return HTTP 200 with ret != 0?
- The QQ Graph API reports many failures as an HTTP 200 response containing a ret value other than zero, so status-code-only monitoring will show a 100 percent success rate while logins silently fail. Check ret explicitly in your callback handling and log the accompanying msg field, and alert on non-zero ret values. Keep in mind the provider absorbs a lot of this parsing, so a bug in that layer cannot be patched in place without forking.
- Can I use socialiteproviders/qq outside Laravel, for example in Symfony or Slim?
- No. The package is a thin driver for laravel/socialite, which is tightly coupled to the Laravel framework, so it is unusable in Symfony, Slim, or other PHP stacks. For non-Laravel projects, use league/oauth2-client with a hand-written QQ provider that handles the URL-encoded token response, the JSONP-wrapped openid call, and the separate profile request. That is more work but avoids fighting an incompatible abstraction.
- Is socialiteproviders/qq still maintained, and what are the alternatives?
- The split repository has had no release since July 2022, roughly 49 stars, and no issue tracker of its own, so treat it as low-maintenance and pin or fork it if you depend on it. The upstream SocialiteProviders/Providers monorepo is where fixes would land, so check whether its main branch works with your Laravel version. If QQ login is really about reaching mainland Chinese users, WeChat is the larger audience and has stronger provider support, though it also requires a Chinese business entity and an ICP-filed domain.