2017 © Pedro Peláez
 

yii2-extension yii2-api-user-rbac

Yii2 module to expose identity and rbac through a restful API

image

macfly/yii2-api-user-rbac

Yii2 module to expose identity and rbac through a restful API

  • Wednesday, November 8, 2017
  • by Macfly
  • Repository
  • 1 Watchers
  • 0 Stars
  • 192 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 14 % Grown

The README.md

yii2-api-user-rbac

Yii2 User and Rbac provider from another Yii2 instance for sso or cenralized way to manage user and role., (*1)

Installation

The preferred way to install this extension is through composer., (*2)

Either run, (*3)

php composer.phar require --prefer-dist "macfly/yii2-api-user-rbac" "*"

or add, (*4)

"macfly/yii2-api-user-rbac": "*"

to the require section of your composer.json file., (*5)

Configure

NOTE: Make sure that you don't have user component configuration in your config files., (*6)

Configure config/web.php as follows, (*7)

'modules' => [
    ................
    'userapi'  => [
        'class'       => 'macfly\user\server\Module',
        // For example if you want to use an oauth2 authentication to get User information,
        // you can of course any way you like to authenticate user.
        'as authenticator'  => [
            'class'         => \filsh\yii2\oauth2server\filters\auth\CompositeAuth::className(),
            'authMethods'   => [
                ['class'    => yii\filters\auth\HttpBearerAuth::className()],
                ['class'    => yii\filters\auth\QueryParamAuth::className(), 'tokenParam' => 'accessToken'],
            ],
        ],
    ],
    ................
],

Usage

Provide the 3 following rest controller/action :, (*8)

  • PUT /userapi/identity/read send read request to Yii::$app->user->identity
  • PUT /userapi/rbac/read send read request to Yii::$app->authManager
  • PUT /userapi/rbac/write send write request to Yii::$app->authManager

The Versions

08/11 2017

dev-master

9999999-dev

Yii2 module to expose identity and rbac through a restful API

  Sources   Download

BSD-3-Clause

The Requires

 

by Charles DELFLY

user yii2 server rbac

01/08 2017

0.1.0

0.1.0.0

Yii2 module to expose identity and rbac through a restful API

  Sources   Download

BSD-3-Clause

The Requires

 

by Charles DELFLY

user yii2 server rbac

10/03 2017

0.0.1

0.0.1.0

Yii2 module to expose identity and rbac through a restful API

  Sources   Download

BSD-3-Clause

The Requires

 

by Charles DELFLY

user yii2 server rbac