PHPackages                             shopwwi/webman-socialite - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. shopwwi/webman-socialite

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

shopwwi/webman-socialite
========================

Webman Socialite

v1.0.3(2y ago)24863↓25%1[1 issues](https://github.com/shopwwi/webman-socialite/issues)1MITPHPPHP ^7.2|^8.0

Since Feb 16Pushed 2y agoCompare

[ Source](https://github.com/shopwwi/webman-socialite)[ Packagist](https://packagist.org/packages/shopwwi/webman-socialite)[ Docs](https://github.com/shopwwi/webman-socialite)[ RSS](/packages/shopwwi-webman-socialite/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (1)

webman-socialite
================

[](#webman-socialite)

webman-socialite 是一个 [OAuth2](https://oauth.net/2/) 社会化认证工具。 它借鉴于 [laravel/socialite](https://github.com/laravel/socialite) ，你可以轻易的运行在webman的laravel/tp/yii等项目中使用它

[!['Latest Stable Version'](https://camo.githubusercontent.com/7d225c8258d40ff695dcbd0eb5b5ed7934e81ce657e5daba21d60801794d8eec/68747470733a2f2f706f7365722e707567782e6f72672f73686f707777692f7765626d616e2d736f6369616c6974652f762f737461626c652e737667)](https://packagist.org/packages/shopwwi/webman-socialite) [!['Total Downloads'](https://camo.githubusercontent.com/1f7343cd390fe175291b43dbfaf75dbb522c65b0a89a62127063b808eca533c4/68747470733a2f2f706f7365722e707567782e6f72672f73686f707777692f7765626d616e2d736f6369616c6974652f642f746f74616c2e737667)](https://packagist.org/packages/shopwwi/webman-socialite) [!['License'](https://camo.githubusercontent.com/57d74f84cfd053263e7b0ca0c222ae26ffc5f5c38d88fb9891f865fb01a8bd17/68747470733a2f2f706f7365722e707567782e6f72672f73686f707777692f7765626d616e2d736f6369616c6974652f6c6963656e73652e737667)](https://packagist.org/packages/shopwwi/webman-socialite)

该工具现已支持平台有：Facebook，Github，Google，Linkedin，Outlook，QQ，TAPD，支付宝，淘宝，百度，钉钉，微博，微信，抖音，飞书，Lark，豆瓣，企业微信，腾讯云，Line，Gitee，Coding。

如果你觉得方便了你，可以为我点个小星星[点击这里 ❤️](https://github.com/shopwwi/webman-socialite)

安装
==

[](#安装)

```
composer require shopwwi/webman-socialite

```

配置
==

[](#配置)

在使用 `Socialite` 之前，您还需要为应用程序使用的 `OAuth` 服务添加凭据。 这些凭证应该放在你的 `config/plugin/shopwwi/socialite/app.php` 配置文件中，并且应该使用密钥 facebook，twitter，linkedin，google，github，gitlab 或 bitbucket， 取决于您的应用程序所需的提供商。 例如：

```
   'driver' => [
      ...
      'qq' => [
          'provider' => \Shopwwi\WebmanSocialite\Providers\QqProvider::class,
          'client_id' => '',
          'client_secret' => '',
          'redirect' => 'http://your-callback-url',
      ],
      ...
   ]
```

使用方法
----

[](#使用方法)

接下来，就要对用户认证了！这需要两个路由：一个路由用于把用户重定向到 OAuth provider，另一个则用于在认证完成后接收相应 `provider` 的回调请求。可以通过 `Socialite facade` 的方式来访问 Socialite：

```
