1. Go to this page and download the library: Download carry0987/falcon library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
$falcon = new \carry0987\Falcon\Falcon($config);
$providerName = $_GET['provider'] ?? 'default';
$provider = $falcon->createProvider($providerName);
// Start the OAuth login process
if (!isset($_GET['code'])) {
$loginUrl = $provider->authorize();
// Redirect user to the login page
header('Location: ' . $loginUrl);
exit;
}
// Handle the callback and retrieve user information
if ($providerName === 'telegram') {
// Special handling for Telegram login flow...
} else {
$accessToken = $provider->getTokenWithAuthCode($_GET['code']);
$user = $provider->getUser();
// Output user information
echo "<pre>" . print_r($user, true) . "</pre>";
}
if (isset($_GET['logout'])) {
$provider->revokeAccessToken($_GET['access_token'] ?? null);
// Redirect back to the login page or homepage
header('Location: ?provider=' . $providerName);
exit;
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.