Skip to content
docsv0.1.0

FacebookOAuthService

Facebook OAuth 2.0 protocol implementation. Uses the Facebook Graph API v21.0 for user info retrieval.

FacebookOAuthService::__construct()

public function __construct(string $appId, string $appSecret):

Parameters

Parameters of __construct()
NameTypeDescription
$appIdstring
$appSecretstring

FacebookOAuthService::getAuthUrl()

public function getAuthUrl(string $redirectUri, ?string $state = null): string

Build the Facebook Login dialog URL requesting the email and public_profile scopes.

Parameters

Parameters of getAuthUrl()
NameTypeDescription
$redirectUristring
$state?string

FacebookOAuthService::exchangeCode()

public function exchangeCode(string $code, string $redirectUri): Milpa\OAuth\DTO\FacebookUserInfo

Exchange the authorization code for an access token, then fetch the profile from the Facebook Graph API.

Parameters

Parameters of exchangeCode()
NameTypeDescription
$codestring
$redirectUristring