forked from phacility/phabricator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPhabricatorAmazonAuthProvider.php
46 lines (38 loc) · 1.24 KB
/
PhabricatorAmazonAuthProvider.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?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';
}
}