EventSubscriber endless redirect
Finally I have solved the issue thanks to the comments I received on my question. Here is the solution I found:

namespace Drupal\my_custom_module\EventSubscriber;

use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;

/**
 * Event subscriber subscribing to KernelEvents::REQUEST.
 */
class RedirectAnonymousSubscriber implements EventSubscriberInterface {

  public function __construct() {
    $this-&gt;account = \Drupal::currentUser();
  }

  public function checkAuthStatus(GetResponseEvent $event) {
    if ($this-&gt;account-&gt;isAnonymous()
      &amp;&amp; \Drupal::service('path.current')-&gt;getPath() != '/cas'
      &amp;&amp; \Drupal::service('path.current')-&gt;getPath() != '/casservice') {
      $response = new RedirectResponse('/cas', 301);
      $event-&gt;setResponse($response);
    }
    return;
  }

  public static function getSubscribedEvents() {
    $events[KernelEvents::REQUEST][] = ['checkAuthStatus', 100];
    return $events;
  }

}


In short, the issue was related with the path checking and the RedirectResponse object management.