Support the ongoing development of →
Configuration Authentication Session
Last updated 2 years ago.

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


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


If not I create a new user and then log them in.

$user = new \User;
$user->id = $id;
$user->password = 'dummy';

if the $_SERVER['AUTH_USER'] is not set then I redirect to the log-in page.


Sign in to participate in this thread!


Your banner here too?

Clarkey clarkey Joined 11 Mar 2014


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 - All rights reserved.