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 309
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 3
Forks: 2
Open Issues: 0
Type:luya-extension
Requires
- luyadev/luya-module-admin: ^3.0|^4.0|^5.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.2
- luyadev/luya-testsuite: ^3.0
- phpstan/phpstan: ^1.7
README
LUYA Admin User Token Module
Extend the LUYA Admin by providing app's which then LUYA Admin users can authenticated through the API.
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
- Create an App in the Admin UI. The App identifier is used for login.
- Use the APIs to make a Login Request for a given User (POST request to
/admin/api-usertoken-login
with fieldsemail
,password
andapp
).
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.