Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

francisceril's avatar

Authenticate login from an external database

Hello,

I'm new to Laravel and I'm trying to learn it with actual personal side projects. I am trying to make a simple inventory app and I want users to be able to log in. I want to fetch users from an external Oracle database so users will be consistent with my existing systems.

I've been searching for tutorials on how to implement this but I'm not able to find one. All tutorials I've seen uses a new database and tries to register new users.

Can someone hint me on how should I do this? Basically I just need to use an existing employee table from an existing Oracle database for the login only.

Regards, Francis

0 likes
3 replies
Snapey's avatar

You can

a) get username and password from user in your Laravel app

b) see if there is an oracle user with that name

c) test the provided password against the other system. Note that you will need to know how/where passwords are stored in the other system

d) manually authenticate the user in Laravel

https://laravel.com/docs/5.8/authentication#other-authentication-methods

You will need users duplicated in a Laravel users database.

1 like
francisceril's avatar

@snapey

It's a fresh Laravel 6 install. I was able to install and connect to my Oracle database by following https://github.com/yajra/laravel-oci8.

I did a successful test with this:

function checkDB() { $users = DB::select('select employee_id, u_password from employees'); print_r($users); }

What do you mean I have to duplicate the users? Is it not possible to directly authenticate from the Oracle database?

Please or to participate in this conversation.