phycom/auth

Phycom平台认证模块

安装: 395

依赖关系: 0

建议者: 0

安全性: 0

类型:yii2-extension

1.1.2 2022-08-19 07:46 UTC

This package is auto-updated.

Last update: 2024-09-19 12:05:52 UTC


README

Phycom平台认证模块

包含一系列可以轻松添加到phycom网站的第三方认证方法。

提供的方法列表

  • Facebook
  • Google

安装

使用Composer安装

composer install phycom/auth

如何使用该模块

  1. 将模块配置添加到您的网站中,请参见此处示例
<?php

return  [
    'modules' => [
        'auth' => [
            'class' => \Phycom\Auth\Module::class,
            'methods' => [
                'google' => [
                    'class' => \Phycom\Auth\Methods\Google\Module::class,
                    'clientId' => '<your google client ID here>'
                ],
                'facebook' => [
                    'class' => \Phycom\Auth\Methods\Facebook\Module::class,
                    'appId' => '<your facebook ap id here>'
                ]
            ]
        ]
    ]
];

  1. 将认证方法添加到您的登录表单中,如下所示

foreach (Yii::$app->getModule('auth')->getMethods() as $method) {
    echo $method->render();
}