I'm not sure how to implement that into Laravel. This is the issue. I can write code for what needs to happen, just not sure how to write it for Laravel.
I had to do something similar recently.
My situation was pretty specific but you could set this up as middleware.
I use Laravel Authentication in conjunction with AD, avery simplified process below
First i check if we have authenticated the user in laravel with
\Auth::check()
If not I check for the $_SERVER['AUTH_USER'].
$id = isset($_SERVER['AUTH_USER'] ? $_SERVER['AUTH_USER'] : false;
If this is set I see if we have the user in Laravel
$user = \User::find($id);
If the user exists I log them in
\Auth::login($user);
If not I create a new user and then log them in.
$user = new \User;
$user->id = $id;
$user->password = 'dummy';
$user->save();
\Auth::login($user);
if the $_SERVER['AUTH_USER'] is not set then I redirect to the log-in page.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community