yiiauth / gitlab

GitLab OAuth2 for yii2-authclient

2.0.0 2021-01-22 18:17 UTC

This package is auto-updated.

Last update: 2024-09-16 14:59:53 UTC


README

本扩展为 yii2-authclient 添加了对 GitLab OAuth2 的支持。

Latest Stable Version Total Downloads Monthly Downloads License

安装

安装此扩展的首选方式是通过 composer

运行以下命令:

php composer.phar require yiiauth/gitlab

或者添加以下内容到你的 composer.json 文件的 require 部分:

"yiiauth/gitlab": "~0.1"

to the require section of your composer.json.

使用方法

您必须阅读 yii2-authclient 的文档

GitLab 中注册您的应用程序

并将 GitLab 客户端添加到您的认证客户端中。

'components' => [
    'authClientCollection' => [
        'class' => yii\authclient\Collection::class,
        'clients' => [
               'gitlab' => [
                   'class' => \yiiauth\gitlab\GitLabClient::class,
                   'domain'  => 'https://gitlab.com',
                   'clientId' => 'gitlab_client_id',
                   'clientSecret' => 'gitlab_client_secret',
               ],
            // other clients
        ],
    ],
    // ...
 ]