ILIAS  trunk Revision v12.0_alpha-16-g3e876e53c80
class.ilECSAuthFactory.php
Go to the documentation of this file.
1<?php
2
18declare(strict_types=1);
19
21{
22 protected readonly ilLogger $logger;
23 protected readonly ilCtrlInterface $ctrl;
24 protected readonly ilLanguage $lng;
25
26 public function __construct()
27 {
28 global $DIC;
29
30 $this->logger = $DIC->logger()->wsrv();
31 $this->ctrl = $DIC->ctrl();
32 $this->lng = $DIC->language();
33 }
34
35 public function build(int $auth_type): ?ilECSAuthStrategy
36 {
37 return match ($auth_type) {
39 new ilLoginPageAuthStrategy($this->ctrl, $this->logger, $this->lng),
41 new ilShibbolethAuthStrategy($this->ctrl, $this->logger),
43 new ilOIDCAuthStrategy($this->ctrl, $this->logger),
44 default => null,
45 };
46 }
47
48 public function getAuthTypes(): array
49 {
50 return [
54 ];
55 }
56
57 public function getAvailableStrategies(): array
58 {
59 $strategies = [];
60 foreach ($this->getAuthTypes() as $auth_type) {
61 $strategy = $this->build($auth_type);
62 if ($strategy->isActive()) {
63 $strategies[$auth_type] = $strategy;
64 }
65 }
66 return $strategies;
67 }
68}
readonly ilLanguage $lng
readonly ilCtrlInterface $ctrl
readonly ilLogger $logger
language handling
Component logger with individual log levels by component id.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: shib_login.php:26