It is a very useful module, but unfortunately it doesn't work with CAS module - https://www.drupal.org/project/cas, i.e. when the authentication is not handled by Drupal's standard login form.

Comments

gintass created an issue. See original summary.

  • Antonnavi committed 6db0c24 on 8.x-1.x
    Issue #3094514: Does not work with CAS: Added test CAS integration,...
Antonnavi’s picture

Version: 8.x-1.3 » 8.x-1.x-dev
Status: Active » Needs review

Hello, Gintas Sekmokas (gintass) !

Test CAS integration was added to DEV branch.
Could you please test it and add feedback here.

gintass’s picture

Hi Anton,
I installed and tested the dev branch of the module, but when I try to login via CAS I get this message:
"The website encountered an unexpected error. Please try again later."
This happens even before I add any paths to this page:
admin/people/login-and-logout-redirect-per-role

Drupal log has this error message:
TypeError: Argument 2 passed to Drupal\cas\Controller\ServiceController::__construct() must be an instance of Drupal\cas\Service\CasProxyHelper, instance of Drupal\cas\Service\CasValidator given, called in /var/www/dev-drupal8/web/modules/contrib/login_redirect_per_role/src/Controller/LoginRedirectPerRoleCasService.php on line 61 in Drupal\cas\Controller\ServiceController->__construct() (line 118 of /var/www/dev-drupal8/web/modules/contrib/cas/src/Controller/ServiceController.php) #0 /var/www/dev-drupal8/web/modules/contrib/login_redirect_per_role/src/Controller/LoginRedirectPerRoleCasService.php(61): Drupal\cas\Controller\ServiceController->__construct(Object(Drupal\cas\Service\CasHelper), Object(Drupal\cas\Service\CasValidator), Object(Drupal\cas\Service\CasUserManager), Object(Drupal\cas\Service\CasLogout), Object(Symfony\Component\HttpFoundation\RequestStack), Object(Drupal\Core\Render\MetadataBubblingUrlGenerator), Object(Drupal\Core\Config\ConfigFactory), Object(Drupal\Core\Messenger\Messenger), Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher), Object(Drupal\externalauth\ExternalAuth)) #1 /var/www/dev-drupal8/web/modules/contrib/login_redirect_per_role/src/Controller/LoginRedirectPerRoleCasService.php(81): Drupal\login_redirect_per_role\Controller\LoginRedirectPerRoleCasService->__construct(Object(Drupal\cas\Service\CasHelper), Object(Drupal\cas\Service\CasValidator), Object(Drupal\cas\Service\CasUserManager), Object(Drupal\cas\Service\CasLogout), Object(Symfony\Component\HttpFoundation\RequestStack), Object(Drupal\Core\Render\MetadataBubblingUrlGenerator), Object(Drupal\Core\Config\ConfigFactory), Object(Drupal\Core\Messenger\Messenger), Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher), Object(Drupal\externalauth\ExternalAuth), Object(Drupal\login_redirect_per_role\LoginRedirectPerRole)) #2 /var/www/dev-drupal8/web/core/lib/Drupal/Core/DependencyInjection/ClassResolver.php(28): Drupal\login_redirect_per_role\Controller\LoginRedirectPerRoleCasService::create(Object(Drupal\Core\DependencyInjection\Container)) #3 /var/www/dev-drupal8/web/core/lib/Drupal/Core/Controller/ControllerResolver.php(120): Drupal\Core\DependencyInjection\ClassResolver->getInstanceFromDefinition('\\Drupal\\login_r...') #4 /var/www/dev-drupal8/web/core/lib/Drupal/Core/Controller/ControllerResolver.php(72): Drupal\Core\Controller\ControllerResolver->createController('\\Drupal\\login_r...') #5 /var/www/dev-drupal8/web/core/lib/Drupal/Core/Controller/ControllerResolver.php(88): Drupal\Core\Controller\ControllerResolver->getControllerFromDefinition('\\Drupal\\login_r...', '/casservice') #6 /var/www/dev-drupal8/vendor/symfony/http-kernel/HttpKernel.php(134): Drupal\Core\Controller\ControllerResolver->getController(Object(Symfony\Component\HttpFoundation\Request)) #7 /var/www/dev-drupal8/vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1) #8 /var/www/dev-drupal8/web/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #9 /var/www/dev-drupal8/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #10 /var/www/dev-drupal8/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(191): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #11 /var/www/dev-drupal8/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(128): Drupal\page_cache\StackMiddleware\PageCache->fetch(Object(Symfony\Component\HttpFoundation\Request), 1, true) #12 /var/www/dev-drupal8/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(82): Drupal\page_cache\StackMiddleware\PageCache->lookup(Object(Symfony\Component\HttpFoundation\Request), 1, true) #13 /var/www/dev-drupal8/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #14 /var/www/dev-drupal8/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #15 /var/www/dev-drupal8/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #16 /var/www/dev-drupal8/web/core/lib/Drupal/Core/DrupalKernel.php(694): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #17 /var/www/dev-drupal8/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #18 {main}.

Antonnavi’s picture

Thank you for help, Gintas!
I'll check what's the issue reason.

Antonnavi’s picture

DEV branch (8.x-1.x-dev) was updated.
Could you test it and put there results of tests plz.

gintass’s picture

The module works fine with the CAS module. Thank you very much!

Antonnavi’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.