luyadev/luya-module-admin-usertoken

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

Installs: 3 316

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 3

Forks: 2

Open Issues: 0

Type:luya-extension

1.3.1 2023-12-14 08:30 UTC

This package is auto-updated.

Last update: 2024-11-14 10:23:00 UTC


README

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.