OAuth1.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2018-2024 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
  5. * SPDX-License-Identifier: AGPL-3.0-only
  6. */
  7. namespace OCA\Files_External\Lib\Auth\OAuth1;
  8. use OCA\Files_External\Lib\Auth\AuthMechanism;
  9. use OCA\Files_External\Lib\DefinitionParameter;
  10. use OCP\IL10N;
  11. /**
  12. * OAuth1 authentication
  13. */
  14. class OAuth1 extends AuthMechanism {
  15. public function __construct(IL10N $l) {
  16. $this
  17. ->setIdentifier('oauth1::oauth1')
  18. ->setScheme(self::SCHEME_OAUTH1)
  19. ->setText($l->t('OAuth1'))
  20. ->addParameters([
  21. (new DefinitionParameter('configured', 'configured'))
  22. ->setType(DefinitionParameter::VALUE_HIDDEN),
  23. new DefinitionParameter('app_key', $l->t('App key')),
  24. (new DefinitionParameter('app_secret', $l->t('App secret')))
  25. ->setType(DefinitionParameter::VALUE_PASSWORD),
  26. (new DefinitionParameter('token', 'token'))
  27. ->setType(DefinitionParameter::VALUE_HIDDEN),
  28. (new DefinitionParameter('token_secret', 'token_secret'))
  29. ->setType(DefinitionParameter::VALUE_HIDDEN),
  30. ])
  31. ->addCustomJs('oauth1')
  32. ;
  33. }
  34. }