ngekoding/google-login
最新稳定版本:v1.0.0
Composer 安装命令:
composer require ngekoding/google-login
包简介
The easy way to integrate Google Login into PHP application.
README 文档
README
The easy way to integrate Google Login into PHP application.
Requirements
- PHP 5.6 or above
- The OAuth client ID from Google Cloud Console
Installation
composer require ngekoding/google-login
Usage
Just call the auth method and you are done!
<?php // Include the autoload require_once 'vendor/autoload.php'; // Prepare the configs $clientId = 'YOUR CLIENT ID'; $clientSecret = 'YOUR CLIENT SECRET'; $redirectUri = 'YOUR REDIRECT URI'; // The URL to this file/endpoint $googleLogin = new \Ngekoding\GoogleLogin\GoogleLogin($clientId, $clientSecret, $redirectUri); try { $googleLogin->auth(); header('Content-Type: application/json'); echo json_encode($googleLogin->user()); } catch (\Exception $e) { echo 'Error: '.$e->getMessage(); }
统计信息
- 总下载量: 59
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-08-28