I want to create a Yii2 Application for use in my companies intranet. I have access to the NT-username of the client with $_SERVER[‘REMOTE_USER’]. This name I can use to query the active directory for more information (full name, department, etc.). I want to create my own user class, that is populated with this information and more. I want to access it through Yii::$app->user. The code to query the active directory is available and working.
I had a look at the default implementation and I am not sure if implementing \yii\web\IdentityInterface is suitable in this case.
The user shouldn’t need to do anything since he should automatically be logged-in. If (for some reason) the user does not exist in the active directory an error page should be shown.
Can you show some example code for me to better understand this?
Thank you. I need to do all this automatically in the background. User should never see any username / password prompt. I just need some info on how to wire up the logic in the Yii2 framework. Maybe I should write my own component to handle this, not sure how this will affect any other base components of the framework.
I never said I needed a manual login. All this should be done automatically. I will probably try implementing a custom module in the next few days. I also might need to change AccessRule and AccessControl.