B
B
betrachter2017-07-27 17:27:38
Yii
betrachter, 2017-07-27 17:27:38

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);

Can you please tell me where is the right place to start the authentication process?
Thanks in advance

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2017-07-27
@webinar

The user data is returned from the external resource.

That's where you launch it. There are other options?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question