Revision #25 has been created by
rackycz on Oct 10, 2025, 7:17:37 AM with the memo:
edit
« previous (#24) next (#26) »
Changes
Title
unchanged
Yii3 - How to start
Category
unchanged
Tutorials
Yii version
unchanged
3.0
Tags
unchanged
Content
changed
[...]
Below I am indicating how to implement "Random Token Authentication". Other options would be:
- JWT (JSON Web Token) .. I see some disadvatages
- OAuth, OAuth2 - too complex for a simple API
Before you start, install dependency:
- composer require yiisoft/security
Let's create a migration for storing the access tokens:
```php
// method up():
$b->createTable('user_token', [
'id' => $b->primaryKey(),[...]