This commit is contained in:
Jaybe
2025-03-05 14:10:06 +09:00
commit 7a77932344
1905 changed files with 122510 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
<?php
/*!
* A simple example that shows how to connect users to providers using OpenID.
*/
include 'vendor/autoload.php';
$config = [
'callback' => Hybridauth\HttpClient\Util::getCurrentUrl(),
'openid_identifier' => 'https://open.login.yahooapis.com/openid20/www.yahoo.com/xrds',
// 'openid_identifier' => 'https://openid.stackexchange.com/',
// 'openid_identifier' => 'http://steamcommunity.com/openid',
// etc.
];
try {
$adapter = new Hybridauth\Provider\OpenID($config);
$adapter->authenticate();
$tokens = $adapter->getAccessToken();
$userProfile = $adapter->getUserProfile();
// print_r($tokens);
// print_r($userProfile);
$adapter->disconnect();
} catch (Exception $e) {
echo $e->getMessage();
}