ILIAS  trunk Revision v12.0_alpha-16-g3e876e53c80
class.ilOIDCAuthStrategy.php
Go to the documentation of this file.
1<?php
2
18declare(strict_types=1);
19
21{
22 public function __construct(
23 private readonly ilCtrlInterface $ctrl,
24 private readonly ilLogger $logger
25 ) {
26 }
27
28 public function isActive(): bool
29 {
30 return ilOpenIdConnectSettings::getInstance()->getActive();
31 }
32
33 public function getName(): string
34 {
35 return 'oidc';
36 }
37
38 public function handleLogin(string $redirection_target): void
39 {
40 // the target may be '/goto.php/crs/123' which is not supported by oidc (see `LegacyGotoHandler::handle`)
41 // instead it should be 'crs_123' and will be built to '/goto.php/?target=crs_123' in oidc login page
42 if (str_contains($redirection_target, 'goto.php/')) {
43 $redirection_target = ltrim(str_replace('goto.php', '', $redirection_target), '/');
44 $redirection_target = str_replace('/', '_', $redirection_target);
45 }
46
47 $this->logger->info('Redirect to oidc authentication');
48 $this->ctrl->redirectToURL('openidconnect.php?target=' . $redirection_target);
49 }
50}
Component logger with individual log levels by component id.
__construct(private readonly ilCtrlInterface $ctrl, private readonly ilLogger $logger)
handleLogin(string $redirection_target)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...