arrow_back
Back

Yii2 authentication and authorization: Identity and user component

Andrew Dorokhov Andrew Dorokhov schedule 1 min read

Firstly, we have to implement authentication.

The user application component manages the user authentication status. It requires us to specify an identity class which contains the actual authentication logic.

return [
    'components' => [
        'user' => [
            'identityClass' => 'app\models\User',
        ],
    ],
];
code

Need Help with Development?

Happy to help — reach out via the contacts or go straight to my Upwork profile.

work View Upwork Profile arrow_forward
Next Article

Yii2 database migrations: up, down, and console commands

arrow_forward