swerrie/eveonline-socialite
Composer 安装命令:
composer require swerrie/eveonline-socialite
包简介
EveOnline SSO Provider for Laravel Socialite
README 文档
README
Installation and config
Install Larvel Socialite (see here: https://github.com/laravel/socialite/blob/2.0/readme.md)
Install the eveonline socialite provider
composer require swerrie/eveonline-socialite
Add the follwing to your .env file:
EVEONLINE_CLIENT_ID=
EVEONLINE_CLIENT_SECRET=
EVEONLINE_REDIRECT=
(Get your Eve Online SSO credentials here: https://developers.eveonline.com/applications/)
Add the following to your config/app.php
swerrie\Socialite\EveOnline\EveOnlineServiceProvider::class,
Usage
<?php
namespace App\Http\Controllers\Auth;
use Socialite;
class AuthController extends Controller
{
/**
* Redirect the user to the GitHub authentication page.
*
* @return Response
*/
public function redirectToProvider()
{
return Socialite::driver('eveonline')->redirect();
}
/**
* Obtain the user information from GitHub.
*
* @return Response
*/
public function handleProviderCallback()
{
$user = Socialite::driver('eveonline')->user();
//dd($user);
}
}
Retrieving User Details
Once you have a user instance, you can grab a few more details about the user:
$user = Socialite::driver('eveonline')->user();
$token = $user->token;
$expiresIn = $user->expiresIn;
$user->getId();
$user->getName();
$user->getAvatar();
统计信息
- 总下载量: 2
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-05-08