Skip to content

Extend the LUYA Admin by providing app's based access token accessible through an API.

License

Notifications You must be signed in to change notification settings

luyadev/luya-module-admin-usertoken

Repository files navigation

LUYA Logo

LUYA Admin User Token Module

LUYA Tests Maintainability Test Coverage

Extend the LUYA Admin by providing app's which then LUYA Admin users can authenticated through the API.

LUYA Admin Interface

Installation

Install the extension through composer:

composer require luyadev/luya-module-admin-usertoken

add to the config

'modules' => [
    //...
    'usertoken' => [
      'class' => 'luya\admin\usertoken\Module',
    ]
]

bootstrap the app:

'bootstrap' => [
    'luya\admin\usertoken\Bootstrap',
]

Run the import command afterwards:

./luya migrate
./luya import

Usage

  1. Create an App in the Admin UI. The App identifier is used for login.
  2. Use the APIs to make a Login Request for a given User (POST request to /admin/api-usertoken-login with fields email, password and app).

Caveats

When a user is authenaticated and an access token is generated, all API requests with this token will be threated as this user. Also in terms of "language". You are not able to force a certain language with f.e. _lang since the user Admin UI Settings will be loaded. In order to change that behavior and force a certain fixed language see Module::$forceUserLanguage property.

About

Extend the LUYA Admin by providing app's based access token accessible through an API.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages