mariovalney / laravel-keycloak-web-guard

Simple Keycloak Guard to Laravel Web Routes - https://packagist.org/packages/vizir/laravel-keycloak-web-guard
146 stars 80 forks source link

Unable to load the home page after the keycloak login is successfull. #27

Closed Mounika-12 closed 4 years ago

Mounika-12 commented 4 years ago

Hi,

I have done all the changes to integrate keycloak to my laravel application and I am able to authenticate. Once the keycloak login is successful app should redirect to home page. I have changed RouterServiceProvider.php like below. Here the UI routes(using Vue) which I am triggering through web.php file is not getting loaded. If I don't use keycloak-web middleware all the routes are working but there will no keycloak authentication.

protected function mapWebRoutes()
    {
        Route::prefix('admin')
            ->middleware('keycloak-web')
            ->namespace($this->namespace)
            ->group(base_path('routes/web.php'));

        // Route::middleware('web')
        //     ->namespace($this->namespace)
        //     ->group(base_path('routes/web.php'));
    }

I am getting 404 not found for all the routes. Please help me regarding my issue.

mariovalney commented 4 years ago

Hi. I'm not sure this is the problem, but we have to start from beginning.

In commented routes, there's no prefix. Are you adding the prefix to path when using when keycloak-web?

mariovalney commented 4 years ago

Hi. Is it solved?