承接 waglpz/google-sso 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

waglpz/google-sso

Composer 安装命令:

composer require waglpz/google-sso

包简介

Single sign on with Google. Minimal implementation.

README 文档

README

The Google SSO Client Library enables you to work with single sign on via Google API.

Requirements

PHP 8.2 or higher

Installation

composer require waglpz/google-sso:"^1.0"

Authentication with OAuth

  1. Follow the instructions to Create Web Application Credentials
  2. Download the JSON credentials in some hidden directory and include this one path in config.
  3. Set the path to these credentials using config authConfig.
  4. Set the scopes required for the API you are going to call using config key scopes
  5. Set your application's redirect URI in config
  6. Set expected prompt when redirect to google. These can none, consent or select_account.
  7. In the script handling the redirect URI, exchange the authorization code for an access token:
Example
  $config = include __DIR__ . '/../config/sso.php';
  $googleSSO = new \GoogleSSO\GoogleSSO($config);
  $authorizationCodeUrl = $googleSSO->createAuthUrl();
  // Go to the $authorizationCodeUrl and select account you will authenticate against.
  // these will redirect you to defined/known redirect URI and a PHP script will use the code which sends back from Google.
  $accountData = $googleSSO->fetchAccountDataUsingAuthorizationCode($_GET['code']);
  // $accountData contains necessary information if one was founded by google

Code Quality and Testing

To check for coding style violations, run

composer waglpz:code:style:check

To automatically fix (fixable) coding style violations, run

composer waglpz:code:style:fix

To check for static type violations, run

waglpz:code:analyse

To check for regressions, run

composer waglpz:test:norma

To check all violations at once, run

composer waglpz:check:normal

统计信息

  • 总下载量: 3.8k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-09-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固