Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/auth/provider/PhabricatorAmazonAuthProvider.php
12256 views
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 this service 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
}
47
48