- Introduced `ddev` configuration for Laravel-based SAML SSO setup. - Added detailed technical specifications for SAML 2.0 integration, including endpoints, flows, and cryptographic signing. - Created extensive unit tests to validate `SamlIdpController` and `SamlIdpService` functionalities. - Enhanced metadata generation, SAML request parsing, and cryptographic signing of responses. - Implemented models, services, and tests to standardize IdP interactions with Service Providers.
28 lines
715 B
PHP
28 lines
715 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\Helpers\DashboardRoute;
|
|
use Illuminate\Http\Request;
|
|
|
|
class ResolveDashboardRouteController extends Controller
|
|
{
|
|
public function __invoke(Request $request)
|
|
{
|
|
/**
|
|
* If the user is redirected after SAML SSO Login (Foritfy Response always redirects to dashboard),
|
|
* redirect them to the SSO endpoint, So that SAML SSO Login can be completed.
|
|
*/
|
|
if (session()->has('saml_pending_request')) {
|
|
return redirect()->route('saml.sso');
|
|
}
|
|
|
|
$user = $request->user();
|
|
$route = DashboardRoute::resolve($user->getRoleNames());
|
|
|
|
return to_route($route);
|
|
}
|
|
}
|