PHPackages                             nyan02/kphp\_oauth2\_google - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. nyan02/kphp\_oauth2\_google

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

nyan02/kphp\_oauth2\_google
===========================

Google OAuth 2.0 Client Provider for KPHP OAuth2 Client

1.0.1(3y ago)013MITPHPPHP &gt;=7.4

Since Mar 14Pushed 3y ago1 watchersCompare

[ Source](https://github.com/catnyan02/kphp_oauth2_google)[ Packagist](https://packagist.org/packages/nyan02/kphp_oauth2_google)[ RSS](/packages/nyan02-kphp-oauth2-google/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

This package provides Google OAuth 2.0 support for the KPHP

### Installation

[](#installation)

To install, use composer:

`composer require nyan02/kphp_oauth2_google`

### Usage

[](#usage)

Usage is similar to KPHP OAuth client, using nyan02\\kphp\_oauth2\_client\\Provider\\Google as the provider.

You need to create a new Provider object specifying google-client-id, google-client-secret and callback-url.

If you want to restrict access and allow it only for users on your G Suite/Google Apps for Business accounts (corporate emails), you can configure the provider to set Hosted Domain.

You can see the example below.

### Authorization Code Example

[](#authorization-code-example)

```
