Answer the question
In order to leave comments, you need to log in
Yii2. How to authenticate a user by given parameters?
Hello.
There is a site on Yii2 in the internal network, user authentication occurs through an external resource.
The user data is returned from the external resource.
It is necessary to authenticate the user according to the received parameters without transferring him to the authorization form.
This code in the authorization form works correctly:
$identity = User::findOne(['username' => $username]);
Yii::$app->user->login($identity);
Answer the question
In order to leave comments, you need to log in
The user data is returned from the external resource.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question