departmentofhealth/yii2-dohclient 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

departmentofhealth/yii2-dohclient

Composer 安装命令:

composer require departmentofhealth/yii2-dohclient

包简介

doh oauth2 client

README 文档

README

การติดตั้ง

สามารถติดตั้งผ่าน composer โดยรันคำสั่ง

php composer require --prefer-dist departmentofhealth/yii2-dohclient "*"

หรือเพิ่มคำสั่งนี้

"departmentofhealth/yii2-dohclient": "*"

ที่ไฟล์ composer.json ในส่วนของ require

ลงทะเบียนเข้าใช้งาน DOH SSO

  • ลงทะเบียนเข้าใช้งานที่ http://sso.anamai.moph.go.th
  • กรอกข้อมูลส่วนตัว
  • สร้าง Application และกรอก redirect url จะได้ clientID, clientSecret

การใช้งานร่วมกับ yii2-user

ตั้งค่า authClientCollection ที่ main.php ใสส่วนของ components

...

        'authClientCollection' => [
            'class'   => \yii\authclient\Collection::className(),
            'httpClient' => [
                'transport' => 'yii\httpclient\CurlTransport',
            ],
            'clients' => [
               'doh' => [
                    'class' => 'departmentofhealth\yii2\dohclient\DohClientDektrium',
                    'clientId' => '<clientID>',
                    'clientSecret' => '<ClientSecret>',
                ],
            ],
        ],
...

ทำการ override view yii2-user และเรียกใช้งาน widget ที่หน้า login

<?php
    $authAuthChoice = AuthChoice::begin([
        'baseAuthUrl' => ['/user/security/auth'],
        'popupMode' => false,
        'options'=>[
            'class'=>'auth-clients text-center',
        ]
    ]);
    echo 'Login with: ';
    foreach ($authAuthChoice->getClients() as $key => $client): ?>
<?= $authAuthChoice->clientLink($client,strtoupper($key));?>
<?php endforeach; ?>
<?php AuthChoice::end(); ?>

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2017-02-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固