worteks/yii2auth-oidc

yii2-authclient 的 OIDC 连接器

0.2 2020-01-10 11:21 UTC

This package is auto-updated.

Last update: 2024-09-10 21:26:05 UTC


README

此扩展为 OIDC 支持添加到 yii2-authclient

Latest Stable Version Total Downloads Monthly Downloads License

安装

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

运行以下命令之一

php composer.phar require worteks/yii2auth-oidc

或将以下内容添加到您的 composer.json 的 require 部分。

"worteks/yii2auth-oidc": "~0.2"

使用方法

您必须阅读 yii2-authclient 的 文档

设置一个 OpenID 提供者 (OP) 并在您的认证服务器上将您的 Yii2 应用程序配置为信任方 (RP)。

示例应用程序配置

'components' => [
   'authClientCollection' => [
     'clients' => [
        // ...
        'oidc' => [
          'class' => 'worteks\yii\authclient\OIDC',
          'domain' => 'https://auth.example.com',
          'clientId' => 'myClientId',
          'clientSecret' => 'myClientSecret',
        ],
     ],
    // ...
]