Show different login formsand use different login auth Laravel Authentication - laravel

Is it possible to modify the Laravel App Authentication? like I want to show different forms per different login route, like If I have 2 different login routes for admin and user.
Admin login route, can access the admin dashboard
/app/system/login
User login route, can access only the user page
/app/system/user/login
I tried to do
php artisan route:list
and I see this
LoginController#login
LoginController#showLoginForm
but I don't know where to find them to modify those for my requirements. Any help, ideas please?

You can edit Auth Controller is in Http/Controllers/Auth/AuthController.php, functions get import from file Illuminate/Foundation/Auth/AuthenticatesUsers.php.
Read to documentation how create other auth.

Related

Laravel Passport Get Auth user if logged in on public routes

I am developing a store.
For some routes that are public, I need to get the user's information if the user has entered the site. I use Laravel Passport. I use Middleware for private routes, but for this route, I need people to access it without entering the site.

laravel 7 role base authentication sharing session cookies user can accsess admin panel without any restriction how to solve this problem

I'm using laravel 7 i was created roll base authentication using laravel UI, when i tried cross check logged with user in chrome browser, in edge browser i was logged with as admin, after i shared cookies by using inspect-application copied admin cookies and replaced chrome user cookies with admin cookies and refreshed page after refreshing page i get admin access with admin credential. how to solve this problem pls help.
The solution is adding 'password.confirm' middleware to your sensitive routes
like admin dashboard ex:
Route::middleware('password.confirm')->group(function () {
Route::get('/dashboard',[AdminDashboardController::class, 'index'])->name('.index');
});
i hope it was useful .

How to make Login Authentication in CodeIgniter for multiple user

I have not Idea Please help me
I will try to make Login Authentication in CodeIgniter for multiple user its define role and its check on controller. But I want to make with helper.

Keycloak login page with Laravel

Good Day,
It's possible to use change the login of laravel page into keycloak page? And after login successful, it will redirect back to laravel home page with auth details from keycloak?
It's there any method to implement keycloak login to laravel? thanks.
Yes its possible, keycloak would be the identity provider, and laravel would be a oidc/oauth2 client, after a succusful login, you should be redirected to laravel logegd in.
This might help https://github.com/Vizir/laravel-keycloak-web-guard

How to redirect user back to the next request after login with sentry in laravel 5.3

I am using sentry to authenticate users in laravel 5.3. When the user clicks auth protected route is redirect to the login form. After login, the user is redirected to home page.
How can I configure sentry in manner that the authenticated user is not redirected back to home page but instead to the original destination before login. Kindly assist I seem not to figure it out.
You can use a function called intended
return redirect()->intended('dashboard');
The intended method on the redirector will redirect the user to the URL they were attempting to access before being intercepted by the authentication middleware. A fallback URI may be given to this method in case the intended destination is not available.
https://laravel.com/docs/5.3/authentication#authenticating-users
Maybe this may help you --
You can try giving the url something like this localhost:8000/something?url=anythingelse so that after login change the redirect path to $_GET['url'].
Use a form rather than link to go to login page. Try this --
<form method="GET" url="{{ url('/some') }}?{{ Request::path() }}" id="login"></form>
Login

Resources