Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96181842
PhabricatorAuthProviderOAuthGitHub.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Dec 23, 13:11
Size
1 KB
Mime Type
text/x-php
Expires
Wed, Dec 25, 13:11 (2 d)
Engine
blob
Format
Raw Data
Handle
23133073
Attached To
rPH Phabricator
PhabricatorAuthProviderOAuthGitHub.php
View Options
<?php
final
class
PhabricatorAuthProviderOAuthGitHub
extends
PhabricatorAuthProviderOAuth
{
public
function
getProviderName
()
{
return
pht
(
'GitHub'
);
}
protected
function
newOAuthAdapter
()
{
return
new
PhutilAuthAdapterOAuthGitHub
();
}
protected
function
getLoginIcon
()
{
return
'Github'
;
}
public
function
isEnabled
()
{
return
parent
::
isEnabled
()
&&
PhabricatorEnv
::
getEnvConfig
(
'github.auth-enabled'
);
}
protected
function
getOAuthClientID
()
{
return
PhabricatorEnv
::
getEnvConfig
(
'github.application-id'
);
}
protected
function
getOAuthClientSecret
()
{
$secret
=
PhabricatorEnv
::
getEnvConfig
(
'github.application-secret'
);
if
(
$secret
)
{
return
new
PhutilOpaqueEnvelope
(
$secret
);
}
return
null
;
}
public
function
shouldAllowLogin
()
{
return
true
;
}
public
function
shouldAllowRegistration
()
{
return
PhabricatorEnv
::
getEnvConfig
(
'github.registration-enabled'
);
}
public
function
shouldAllowAccountLink
()
{
return
true
;
}
public
function
shouldAllowAccountUnlink
()
{
return
!
PhabricatorEnv
::
getEnvConfig
(
'github.auth-permanent'
);
}
}
Event Timeline
Log In to Comment