1. Go to this page and download the library: Download stgbundle/cas-bundle library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
// src/Controller/DefaultController.php
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
class DefaultController
{
#[Route('/failure', name: 'failure')]
public function failure(Request $request): Response
{
return new Response(
'Error al autenticar - Usuario: ' . $request->get('user')
);
}
#[Route('/secure/logout', name: 'logout')]
public function logout()
{
}
#[Route('/cas/check', name: 'cas_check')]
public function casCheck(): Response
{
// El CasAuthenticator intercepta esta ruta cuando CAS redirige con ?ticket=
// Si se llega aquí sin ticket, redirigir al inicio.
return new RedirectResponse('/');
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.