Download the PHP package wenprise/socialite without Composer
On this page you can find all versions of the php package wenprise/socialite. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package socialite
Socialite
Socialite is an OAuth2 Authentication tool. It is inspired by laravel/socialite, You can easily use it in any PHP project.
Requirement
Installation
Usage
For Laravel 5: overtrue/laravel-socialite
authorize.php
:
callback.php
:
Configuration
Now we support the following sites:
facebook
, github
, google
, linkedin
, outlook
, weibo
, taobao
, qq
, wechat
, douyin
, and douban
.
Each driver uses the same configuration keys: client_id
, client_secret
, redirect
.
Example:
Scope
Before redirecting the user, you may also set "scopes" on the request using the scope method. This method will overwrite all existing scopes:
Redirect URL
You may also want to dynamicly set redirect
,you can use the following methods to change the redirect
URL:
WeChat scopes:
snsapi_base
,snsapi_userinfo
- Used to Media Platform Authentication.snsapi_login
- Used to web Authentication.
Additional parameters
To include any optional parameters in the request, call the with method with an associative array:
User interface
Standard user api:
You can fetch the user attribute as a array keys like these:
Or using the method:
Get original response from OAuth API
The $user->getOriginal()
method will return an array of the API raw response.
Get access token Object
You can get the access token instance of current session by call $user->getToken()
or $user->getAccessToken()
or $user['token']
.
Get user with access token
Custom Session or Request instance.
You can set the request with your custom Request
instance which instanceof Symfony\Component\HttpFoundation\Request
before you call driver
method.
Or set request to SocialiteManager
instance:
You can get the request from the SocialiteManager
instance by getRequest()
:
Set custom session manager.
By default, the SocialiteManager
uses the Symfony\Component\HttpFoundation\Session\Session
instance as session manager, you can change it as follows:
Your custom session manager must be implement the
Symfony\Component\HttpFoundation\Session\SessionInterface
.
Enjoy it! :heart:
Reference
- Google - OpenID Connect
- Facebook - Graph API
- Linkedin - Authenticating with OAuth 2.0
- 微博 - OAuth 2.0 授权机制说明
- QQ - OAuth 2.0 登录QQ
- 微信公众平台 - OAuth文档
- 微信开放平台 - 网站应用微信登录开发指南
- 微信开放平台 - 代公众号发起网页授权
- 豆瓣 - OAuth 2.0 授权机制说明
- 抖音 - 网站应用开发指南
PHP 扩展包开发
想知道如何从零开始构建 PHP 扩展包?
请关注我的实战课程,我会在此课程中分享一些扩展开发经验 —— 《PHP 扩展包实战教程 - 从入门到发布》
License
MIT
All versions of socialite with dependencies
ext-json Version *