Laravel Socialite发起了证书

时间:2015-03-17 14:24:57

标签: laravel oauth-2.0

我想将社交网络整合到基于Laravel的CMS中,我试着弄清楚如果client_id和客户端密钥保存在数据库中,我将如何发起社交网站发送请求?

来自docs基本用法

return Socialize::with('github')->redirect();

和凭据保存在config / services.php

/**
 * Create an instance of the specified driver.
 *
 * @return \Laravel\Socialite\Two\AbstractProvider
 */
protected function createGithubDriver()
{
    $config = $this->app['config']['services.github'];

    return $this->buildProvider(
        'Laravel\Socialite\Two\GithubProvider', $config
    );
}

我想在工厂调用

上定义$ this-> app ['config']

1 个答案:

答案 0 :(得分:0)

你能不能只创建一个中间件类,将它应用到相关路由然后只需使用以下命令设置:

$v = Auth::user()->github // or however you work it out, not sure how you've got it stored
Config::set('services.github', $v);

像这样设置配置只为当前请求设置