Support the ongoing development of Laravel.io →
Authentication Security

I'm migrating an app that does not need to do standard auth. Users first get authenticated and authorized through a university-wide shibboleth single signon system (that I do not manage, but trust). What my app needs to do is:

  1. check for a non-null $_SERVER['REMOTE_USER'] variable (which contains a unique identifier known as "netid")

  2. if the remote_user var is not null, check the value against my user db.

  3. If the user exists, log them in. Otherwise, redirect to a registration form.

Can I leverage the built-in auth system with just a small number of changes to accomplish this?

All I want to do is designate the remote_user var as the credential (rather than email/password) and bypass/ignore any steps involving passwords.

Last updated 3 years ago.
0

I think you can change a bit standard auth middleware (https://github.com/laravel/laravel/blob/master/app/Http/Middleware/Authenticate.php) and check your server variable. If it's null then return response('Unauthorized.', 401) or pass the request otherwise.

0

Sign in to participate in this thread!

PHPverse

Your banner here too?

plweil plweil Joined 21 Aug 2014

Moderators

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

Your logo here?

Laravel.io

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

© 2025 Laravel.io - All rights reserved.