1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-29 02:02:41 +01:00
phorge-phorge/src/applications/auth/provider/PhabricatorAmazonAuthProvider.php
Joshua Spence 701bb2ac6e Rename auth classes for consistency
Summary: Ref T5655. Depends on D9998.

Test Plan: `arc unit`

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: 20after4, epriestley, Korvin

Maniphest Tasks: T5655

Differential Revision: https://secure.phabricator.com/D9999
2014-07-22 21:04:13 +10:00

46 lines
1.2 KiB
PHP

<?php
final class PhabricatorAmazonAuthProvider
extends PhabricatorOAuth2AuthProvider {
public function getProviderName() {
return pht('Amazon');
}
protected function getProviderConfigurationHelp() {
$login_uri = PhabricatorEnv::getURI($this->getLoginURI());
$uri = new PhutilURI(PhabricatorEnv::getProductionURI('/'));
$https_note = null;
if ($uri->getProtocol() !== 'https') {
$https_note = pht(
'NOTE: Amazon **requires** HTTPS, but your Phabricator install does '.
'not use HTTPS. **You will not be able to add Amazon as an '.
'authentication provider until you configure HTTPS on this install**.');
}
return pht(
"%s\n\n".
"To configure Amazon OAuth, create a new 'API Project' here:".
"\n\n".
"http://login.amazon.com/manageApps".
"\n\n".
"Use these settings:".
"\n\n".
" - **Allowed Return URLs:** Add this: `%s`".
"\n\n".
"After completing configuration, copy the **Client ID** and ".
"**Client Secret** to the fields above.",
$https_note,
$login_uri);
}
protected function newOAuthAdapter() {
return new PhutilAmazonAuthAdapter();
}
protected function getLoginIcon() {
return 'Amazon';
}
}