Page MenuHomePhabricator
Diviner Phabricator Tech Docs PhutilOAuthAuthAdapter

abstract class PhutilOAuthAuthAdapter
Phabricator Technical Documentation (Auth)

Abstract adapter for OAuth2 providers.

Methods

final public function getAccountIdentifiers()
Inherited

This method is not documented.
Return
wild

protected function newAccountIdentifiers()
Inherited

This method is not documented.
Return
wild

final protected function newAccountIdentifier($raw_identifier)
Inherited

This method is not documented.
Parameters
$raw_identifier
Return
wild

public function getAccountID()
Inherited

PhutilAuthAdapter

Get a unique identifier associated with the account.

This identifier should be permanent, immutable, and uniquely identify the account. If possible, it should be nonsensitive. For providers that have a GUID or PHID value for accounts, these are the best values to use.

You can implement newAccountIdentifiers() instead if a provider is unable to emit identifiers with all of these properties.

If the adapter was unable to authenticate an identity, it should return null.

Return
string|nullUnique account identifier, or `null` if authentication failed.

public function getAdapterType()

PhutilAuthAdapter

Get a string identifying this adapter, like "ldap". This string should be unique to the adapter class.

PhutilOAuthAuthAdapter
This method is not documented.
Return
stringUnique adapter identifier.

abstract public function getAdapterDomain()
Inherited

PhutilAuthAdapter

Get a string identifying the domain this adapter is acting on. This allows an adapter (like LDAP) to act against different identity domains without conflating credentials. For providers like Facebook or Google, the adapters just return the relevant domain name.

Return
stringDomain the adapter is associated with.

public function getAdapterKey()
Inherited

PhutilAuthAdapter

Generate a string uniquely identifying this adapter configuration. Within the scope of a given key, all account IDs must uniquely identify exactly one identity.

Return
stringUnique identifier for this adapter configuration.

public function getAccountEmail()
Inherited

PhutilAuthAdapter

Optionally, return an email address associated with this account.

Return
string|nullAn email address associated with the account, or `null` if data is not available.

public function getAccountName()
Inherited

PhutilAuthAdapter

Optionally, return a human readable username associated with this account.

Return
string|nullAccount username, or `null` if data isn't available.

public function getAccountURI()
Inherited

PhutilAuthAdapter

Optionally, return a URI corresponding to a human-viewable profile for this account.

Return
string|nullA profile URI associated with this account, or `null` if the data isn't available.

public function getAccountImageURI()
Inherited

PhutilAuthAdapter

Optionally, return a profile image URI associated with this account.

Return
string|nullURI for an account profile image, or `null` if one is not available.

public function getAccountRealName()
Inherited

PhutilAuthAdapter

Optionally, return a real name associated with this account.

Return
string|nullA human real name, or `null` if this data is not available.

abstract protected function getAuthenticateBaseURI()

This method is not documented.
Return
wild

abstract protected function getTokenBaseURI()

This method is not documented.
Return
wild

abstract protected function loadOAuthAccountData()

This method is not documented.
Return
wild

public function getAuthenticateURI()

This method is not documented.
Return
wild

public function setState($state)

This method is not documented.
Parameters
$state
Return
wild

public function getState()

This method is not documented.
Return
wild

public function setCode($code)

This method is not documented.
Parameters
$code
Return
wild

public function getCode()

This method is not documented.
Return
wild

public function setRedirectURI($redirect_uri)

This method is not documented.
Parameters
$redirect_uri
Return
wild

public function getRedirectURI()

This method is not documented.
Return
wild
This method is not documented.
Return
wild

public function getExtraTokenParameters()

This method is not documented.
Return
wild

public function getExtraRefreshParameters()

This method is not documented.
Return
wild

public function setScope($scope)

This method is not documented.
Parameters
$scope
Return
wild

public function getScope()

This method is not documented.
Return
wild

public function setClientSecret($client_secret)

This method is not documented.
Parameters
PhutilOpaqueEnvelope$client_secret
Return
wild

public function getClientSecret()

This method is not documented.
Return
wild

public function setClientID($client_id)

This method is not documented.
Parameters
$client_id
Return
wild

public function getClientID()

This method is not documented.
Return
wild

public function getAccessToken()

This method is not documented.
Return
wild

public function getAccessTokenExpires()

This method is not documented.
Return
wild

public function getRefreshToken()

This method is not documented.
Return
wild

protected function getAccessTokenData($key, $default)

This method is not documented.
Parameters
$key
$default
Return
wild

public function supportsTokenRefresh()

This method is not documented.
Return
wild

public function refreshAccessToken($refresh_token)

This method is not documented.
Parameters
$refresh_token
Return
wild

protected function loadRefreshTokenData($refresh_token)

This method is not documented.
Parameters
$refresh_token
Return
wild

protected function loadAccessTokenData()

This method is not documented.
Return
wild

private function makeTokenRequest($params)

This method is not documented.
Parameters
array$params
Return
wild

protected function readAccessTokenResponse($body)

This method is not documented.
Parameters
$body
Return
wild

protected function getOAuthAccountData($key, $default)

This method is not documented.
Parameters
$key
$default
Return
wild