gabel/opauth-google-proxy

Opauth的Google认证策略

0.2.7 2018-02-15 15:23 UTC

This package is auto-updated.

Last update: 2024-09-08 19:06:43 UTC


README

Google认证的Opauth策略。

基于https://developers.google.com/accounts/docs/OAuth2使用OAuth 2.0实现。

Opauth是PHP的多认证提供者框架。

入门指南

  1. 安装Opauth-Google

    cd path_to_opauth/Strategy
    git clone git://github.com/uzyn/opauth-google.git Google
  2. https://code.google.com/apis/console/创建Google API项目

    • 您不需要在“服务”选项卡中启用任何服务。
    • 确保访问“API访问”选项卡并创建一个OAuth 2.0客户端ID。
    • 选择应用程序类型为“Web应用程序”
    • 确保将重定向URI设置为实际的OAuth 2.0回调URL,通常是http://path_to_opauth/google/oauth2callback
  3. 配置Opauth-Google策略。

  4. 直接用户到http://path_to_opauth/google进行认证

策略配置

必需参数

<?php
'Google' => array(
	'client_id' => 'YOUR CLIENT ID',
	'client_secret' => 'YOUR CLIENT SECRET'
)

可选参数:scopestateaccess_typeapproval_prompt

参考

许可证

Opauth-Google采用MIT许可证
版权© 2012 U-Zyn Chua (http://uzyn.com)