HybridAuthは、オープン ソースのソーシャル サインオン php ライブラリです。
HybridAuth ライブラリの主な目的は、アプリケーションとさまざまなソーシャル API および ID プロバイダー (Facebook、Twitter、LinkedIn、Google、Yahoo など) との間の抽象 API として機能することです。
HybridAuth を使用すると、ソーシャル サインイン、ソーシャル共有、ユーザー プロファイル、フレンド リスト、アクティビティ ストリーム、ステータス更新などを実装することで、開発者はソーシャル アプリケーションを簡単に構築して、Web サイトの訪問者や顧客をソーシャル レベルで引き付けることができます。
HybridAuth を使用した Hello world:
<?php
$config = dirname(__FILE__) . '/library/config.php';
require_once( "library/Hybrid/Auth.php" );
try{
$hybridauth = new Hybrid_Auth( $config );
$twitter = $hybridauth->authenticate( "Twitter" );
$user_profile = $twitter->getUserProfile();
echo "Hi there! " . $user_profile->displayName;
$twitter->setUserStatus( "Hello world!" );
$user_contacts = $twitter->getUserContacts();
}
catch( Exception $e ){
echo "Ooophs, we got an error: " . $e->getMessage();
}