riverside / web-auth
PHP身份验证库
dev-master
2019-06-15 05:25 UTC
Requires
- php: >=5.3
- ext-curl: *
- ext-json: *
This package is auto-updated.
Last update: 2024-09-15 17:45:45 UTC
README
基于OAuth1和OAuth2的PHP身份验证库。支持的社会服务提供商包括Facebook、Google、Twitter和LinkedIn。
安装
$ php composer.phar install
或
"riverside/web-auth": "1.0"
示例
<?php $client = new \WebAuth\Client('Facebook'); $client ->setClientId($client_id) ->setClientSecret($client_secret) ->setRedirectUri($redirect_uri); if ($identity = $client->getIdentity()) { echo 'Hi, '. $identity->getDisplayName() .'<a href="logout">Log Out</a>'; } else { echo '<a href="'. $client->getAuthUrl() .'">Log In</a>'; }