Download the PHP package professionalweb/socialite without Composer
On this page you can find all versions of the php package professionalweb/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.
For Laravel 5: overtrue/laravel-socialite
Requirement
Installation
Usage
authorize.php:
callback.php:
Configuration
Now we support the following sites:
vkontakte, odnoklassniki, facebook, twitter, github, google, linkedin, weibo, qq, wechat and douban.
Each drive 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 alse want to dynamic 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 key like this:
Or using 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.
Or set request to SocialiteManager instance:
You can get the request from SocialiteManager instance by getRequest():
Set custom session manager.
By default, the SocialiteManager use Symfony\Component\HttpFoundation\Session\Session instance as session manager, you can change it as following lines:
Your custom session manager must be implement the
[Symfony\Component\HttpFoundation\Session\SessionInterface](http://api.symfony.com/3.0/Symfony/Component/HttpFoundation/Session/SessionInterface.html).
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 授权机制说明
- Twitter API
- VK API
- Ok API
License
MIT
All versions of socialite with dependencies
guzzlehttp/guzzle Version ~5.0
symfony/http-foundation Version ~2.8|~2.7|~3.0