Kanata Plugin
This plugin adds an authorization layer where it is configurable which routes will be protected, and a formal way of keeping Users.
Activate plugin:
php kanata plugin:activate UserAuthorization
Publish config file:
php kanata plugin:publish UserAuthorization config
To start with your first user without having to register through the UI, you can seed via kanata command:
php kanata user-auth:seed --name=John [email protected] --password=secret --email-verified
To have the email verified, you'll need 2 items to be in place:
- Mail Plugin installed and active.
- Configuration
authorization.email-confirmation
set totrue
.
Once you have those 2 in place, the system will send an email for confirmation. Without that users will have email set to verified as soon as they register.
this endpoint servers the purpose to generate a Token to be used only once, after that it gets expired.
GET /api/issue-single-use-token
Success:
Status: 200
Header:
Authorization: Bearer {token-value}
Body:
{
"token": "token-value"
}
Errors
422 - Validation/Authorization Error.
500 - Server Error.
php kanata token:issue --name="my-token-name" [email protected]
php kanata user-auth:seed --name="John Doe" [email protected] --password=secret