ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
class.ilSamlAuthFactory.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
26 final class ilSamlAuthFactory
27 {
28  private const METADATA_PATH = 'auth/saml/config';
29 
33  public function auth(string $authSourceName = 'default-sp'): ilSamlAuth
34  {
35  return new ilSimpleSAMLphpWrapper(
36  $authSourceName,
37  $this->getConfigDirectory()
38  );
39  }
40 
44  public function getConfigDirectory(): string
45  {
46  global $DIC;
47 
48  $fs = $DIC->filesystem()->storage();
49 
50  if (!$fs->hasDir(self::METADATA_PATH)) {
51  $fs->createDir(self::METADATA_PATH);
52  }
53 
54  return rtrim(ilFileUtils::getDataDir(), '/') . '/' . self::METADATA_PATH;
55  }
56 }
global $DIC
Definition: shib_login.php:25
auth(string $authSourceName='default-sp')
static getDataDir()
get data directory (outside webspace)
Class ilSimpleSAMLphpWrapper.