定制 jirkavrba/cvut-socialite-provider 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

jirkavrba/cvut-socialite-provider

Composer 安装命令:

composer create-project jirkavrba/cvut-socialite-provider

包简介

A socialite provider for the authentication server of the FIT CTU in Prague

README 文档

README

This is a custom Laravel Socialite provider for the authentication server of the FIT CTU in Prague.

The authentication server can be found here.

Installation

To install this package simply add jirkavrba/cvut-socialite-provider to your composer.json file. This can be also done via the composer command

composer require jirkavrba/cvut-socialite-provider

Then, add your credentials to the .env

CVUT_CLIENT_ID=""
CVUT_CLIENT_SECRET=""
CVUT_CALLBACK_URL=""

and config/services.php

return [
    // Other services
    'cvut' => [
        'client_id'     => env('CVUT_CLIENT_ID'),
        'client_secret' => env('CVUT_CLIENT_SECRET'),
        'redirect'      => env('CVUT_CALLBACK_URL'),
    ],
];

You also need to extend the socialite service within a service provider, this can be done eg. in the AppServiceProvider by creating a private method

private function bootCvutSocialiteProvider()
{
    $socialite = $this->app->make('Laravel\Socialite\Contracts\Factory');
    $socialite->extend(
        'cvut',
        function ($app) use ($socialite) {
            $config = $app['config']['services.cvut'];
            return $socialite->buildProvider(CvutProvider::class, $config);
        }
    );
}

and then call this method from within the boot() method.

This should be all you need to do, then you can simply use the provider within your controllers like:

public function redirectToProvider(): RedirectResponse
{
    return Socialite::with('cvut')->redirect();
}

统计信息

  • 总下载量: 14
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-03-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固