phycom / auth
Phycom平台认证模块
1.1.2
2022-08-19 07:46 UTC
Requires
- php: >=8.0
- phycom/base: >=1.1
This package is auto-updated.
Last update: 2024-09-19 12:05:52 UTC
README
Phycom平台认证模块
包含一系列可以轻松添加到phycom网站的第三方认证方法。
提供的方法列表
安装
使用Composer安装
composer install phycom/auth
如何使用该模块
- 将模块配置添加到您的网站中,请参见此处示例
<?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>'
]
]
]
]
];
- 将认证方法添加到您的登录表单中,如下所示
foreach (Yii::$app->getModule('auth')->getMethods() as $method) {
echo $method->render();
}