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
| Name | Type | Description |
|---|---|---|
| $appId | string | |
| $appSecret | string |
FacebookOAuthService::getAuthUrl()
public function getAuthUrl(string $redirectUri, ?string $state = null): stringBuild the Facebook Login dialog URL requesting the email and public_profile scopes.
Parameters
| Name | Type | Description |
|---|---|---|
| $redirectUri | string | |
| $state | ?string |
FacebookOAuthService::exchangeCode()
public function exchangeCode(string $code, string $redirectUri): Milpa\OAuth\DTO\FacebookUserInfoExchange the authorization code for an access token, then fetch the profile from the Facebook Graph API.
Parameters
| Name | Type | Description |
|---|---|---|
| $code | string | |
| $redirectUri | string |