PHPackages                             departmentofhealth/yii2-dohclient - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. departmentofhealth/yii2-dohclient

ActiveYii2-extension[Authentication &amp; Authorization](/categories/authentication)

departmentofhealth/yii2-dohclient
=================================

doh oauth2 client

0.9.2(9y ago)010Apache-2.0PHP

Since Feb 20Pushed 9y ago1 watchersCompare

[ Source](https://github.com/DepartmentOfHealth/yii2-dohclient)[ Packagist](https://packagist.org/packages/departmentofhealth/yii2-dohclient)[ RSS](/packages/departmentofhealth-yii2-dohclient/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (2)Versions (5)Used By (0)

yii2-dohclient
==============

[](#yii2-dohclient)

การติดตั้ง
----------

[](#การติดตั้ง)

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

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

```

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

```
"departmentofhealth/yii2-dohclient": "*"

```

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

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

[](#ลงทะเบียนเข้าใช้งาน-doh-sso)

- ลงทะเบียนเข้าใช้งานที่
- กรอกข้อมูลส่วนตัว
- สร้าง Application และกรอก redirect url จะได้ clientID, clientSecret

การใช้งานร่วมกับ [yii2-user](https://github.com/dektrium/yii2-user)
-------------------------------------------------------------------

[](#การใช้งานร่วมกับ-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' => '',
                    'clientSecret' => '',
                ],
            ],
        ],
...
```

ทำการ override view [yii2-user](https://github.com/dektrium/yii2-user/blob/0.9.12/docs/overriding-views.md) และเรียกใช้งาน widget ที่หน้า login

```
