[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/applications/auth/provider/ -> PhabricatorAmazonAuthProvider.php (source)

   1  <?php
   2  
   3  final class PhabricatorAmazonAuthProvider
   4    extends PhabricatorOAuth2AuthProvider {
   5  
   6    public function getProviderName() {
   7      return pht('Amazon');
   8    }
   9  
  10    protected function getProviderConfigurationHelp() {
  11      $login_uri = PhabricatorEnv::getURI($this->getLoginURI());
  12  
  13      $uri = new PhutilURI(PhabricatorEnv::getProductionURI('/'));
  14      $https_note = null;
  15      if ($uri->getProtocol() !== 'https') {
  16        $https_note = pht(
  17          'NOTE: Amazon **requires** HTTPS, but your Phabricator install does '.
  18          'not use HTTPS. **You will not be able to add Amazon as an '.
  19          'authentication provider until you configure HTTPS on this install**.');
  20      }
  21  
  22      return pht(
  23        "%s\n\n".
  24        "To configure Amazon OAuth, create a new 'API Project' here:".
  25        "\n\n".
  26        "http://login.amazon.com/manageApps".
  27        "\n\n".
  28        "Use these settings:".
  29        "\n\n".
  30        "  - **Allowed Return URLs:** Add this: `%s`".
  31        "\n\n".
  32        "After completing configuration, copy the **Client ID** and ".
  33        "**Client Secret** to the fields above.",
  34        $https_note,
  35        $login_uri);
  36    }
  37  
  38    protected function newOAuthAdapter() {
  39      return new PhutilAmazonAuthAdapter();
  40    }
  41  
  42    protected function getLoginIcon() {
  43      return 'Amazon';
  44    }
  45  
  46  }


Generated: Sun Nov 30 09:20:46 2014 Cross-referenced by PHPXref 0.7.1