KerberosApacheAuth.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-License-Identifier: AGPL-3.0-or-later
  5. */
  6. namespace OCA\Files_External\Lib\Auth\SMB;
  7. use OCA\Files_External\Lib\Auth\AuthMechanism;
  8. use OCA\Files_External\Lib\DefinitionParameter;
  9. use OCP\Authentication\LoginCredentials\IStore;
  10. use OCP\IL10N;
  11. class KerberosApacheAuth extends AuthMechanism {
  12. /** @var IStore */
  13. private $credentialsStore;
  14. public function __construct(IL10N $l, IStore $credentialsStore) {
  15. $realm = new DefinitionParameter('default_realm', 'Default realm');
  16. $realm
  17. ->setType(DefinitionParameter::VALUE_TEXT)
  18. ->setFlag(DefinitionParameter::FLAG_OPTIONAL)
  19. ->setTooltip($l->t('Kerberos default realm, defaults to "WORKGROUP"'));
  20. $this
  21. ->setIdentifier('smb::kerberosapache')
  22. ->setScheme(self::SCHEME_SMB)
  23. ->setText($l->t('Kerberos ticket Apache mode'))
  24. ->addParameter($realm);
  25. $this->credentialsStore = $credentialsStore;
  26. }
  27. public function getCredentialsStore(): IStore {
  28. return $this->credentialsStore;
  29. }
  30. }