19declare(strict_types=1);
54 if (!$this->
getSettings()->
get(
'apache_enable_auth',
'0')) {
58 if (!$this->
getSettings()->
get(
'apache_auth_authenticate_on_login_page',
'0')) {
62 if ((\defined(
'IL_CERT_SSO') && \
IL_CERT_SSO ===
true) ||
64 $this->
http->wrapper()->query()->has(
'passed_sso')) {
70 if ($this->
http->wrapper()->query()->has(
'target')) {
71 $url = (string) ($this->
http->request()->getServerParams()[
'REQUEST_URI'] ??
'');
72 if (str_starts_with(
$url,
'/')) {
76 if (!str_starts_with(
$url,
'http')) {
77 $parts = parse_url(ILIAS_HTTP_PATH);
81 $uri = new \ILIAS\Data\URI(
$url);
86 $uri = $uri->withPath(str_replace([
'login.php',
'ilias.php'],
'goto.php', $uri->getPath()));
89 'r=' . urlencode($this->
refinery->uri()->toString()->transform($uri))
93 $this->
ctrl->redirectToURL($redirect_url);
103 $mapping_field_name = $this->
getSettings()->get(
'apache_auth_username_direct_mapping_fieldname',
'');
106 $this->
logger->debug($mapping_field_name);
108 switch ($this->
getSettings()->
get(
'apache_auth_username_config_type')) {
110 if (isset($this->
http->request()->getServerParams()[$mapping_field_name])) {
111 $this->
setUsername($this->
http->request()->getServerParams()[$mapping_field_name]);
118 require CollectUsernameProvidersObjective::PATH()
129 $this->
http->wrapper()->query()->retrieve(
'r', $this->refinery->byTrying([
130 $this->refinery->kindlyTo()->string(),
131 $this->refinery->always(
''),
134 if ($target_url ===
'') {
140 if (file_exists(
$path) && is_readable(
$path)) {
141 foreach (file(
$path) as $line) {
143 $valid_hosts[] = trim($line);
153 $target_url = trim($this->
http->wrapper()->query()->retrieve(
'r', $this->refinery->kindlyTo()->string()));
const IL_CERT_SSO(isset($_GET['client_id']))
foreach($components as $component) $resolver
Resolves a username by selecting the first provider (by descending priority) that returns a non-empty...
tryAuthenticationOnLoginPage()
Check if an authentication attempt should be done when login page has been called.
readonly ilSetting $settings
__construct(private readonly GlobalHttpState $http, private readonly Factory $refinery, private readonly ilCtrlInterface $ctrl)
const int APACHE_AUTH_TYPE_DIRECT_MAPPING
const int APACHE_AUTH_TYPE_BY_FUNCTION
setUsername(string $a_name)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static supportsRedirects()
Are redirects supported?
Util class various functions, usage as namespace.
static getHtmlPath(string $relative_path)
get url of path
static appendUrlParameterString(string $a_url, string $a_par, bool $xml_style=false)
Interface GlobalHttpState.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
static http()
Fetches the global http state from ILIAS.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc