PHPackages                             sadiq-bd/google-auth - 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. sadiq-bd/google-auth

ActiveLibrary

sadiq-bd/google-auth
====================

Google Auth lib for PHP

1.1.0(2y ago)27PHPPHP &gt;=8.0

Since Feb 3Pushed 10mo ago1 watchersCompare

[ Source](https://github.com/sadiq-bd/google-auth)[ Packagist](https://packagist.org/packages/sadiq-bd/google-auth)[ RSS](/packages/sadiq-bd-google-auth/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)DependenciesVersions (3)Used By (0)

 [![Repo views](https://camo.githubusercontent.com/63f0a59ed643baea5fc12528cc11b82f7d24a9d0635d5b3fc44df335f043b999/68747470733a2f2f6170692e73616469712e776f726b6572732e6465762f6170702f6769746875622f7265706f2f676f6f676c652d617574682f7669657773)](https://camo.githubusercontent.com/63f0a59ed643baea5fc12528cc11b82f7d24a9d0635d5b3fc44df335f043b999/68747470733a2f2f6170692e73616469712e776f726b6572732e6465762f6170702f6769746875622f7265706f2f676f6f676c652d617574682f7669657773)

Google Auth
===========

[](#google-auth)

A simple and efficient Google Authentication Library for PHP.

---

Table of Contents
-----------------

[](#table-of-contents)

- [Features](#features)
- [Installation](#installation)
- [Quick Start](#quick-start)
- [Usage](#usage)
- [Configuration](#configuration)
- [API Reference](#api-reference)
- [Contributing](#contributing)
- [License](#license)

---

Features
--------

[](#features)

- 🔒 Easy integration with Google OAuth2
- 📦 Lightweight &amp; dependency friendly
- 📝 Well-documented and simple API
- ⚡ Fast and secure authentication
- 🛡️ Follows best security practices

---

Installation
------------

[](#installation)

Install via [Composer](https://getcomposer.org/):

```
composer require sadiq-bd/google-auth
```

---

Quick Start
-----------

[](#quick-start)

```
require 'vendor/autoload.php';

use SadiqBd\GoogleAuth\GoogleAuth;

$googleAuth = new GoogleAuth(
    'YOUR_CLIENT_ID',
    'YOUR_CLIENT_SECRET',
    'YOUR_REDIRECT_URI'
);

// Redirect to Google OAuth
header('Location: ' . $googleAuth->createAuthUrl());
exit();
```

---

Usage
-----

[](#usage)

### 1. Configure Google Console

[](#1-configure-google-console)

- Go to [Google Cloud Console](https://console.cloud.google.com/apis/credentials)
- Create a new OAuth 2.0 Client ID
- Set your redirect URI

### 2. Authenticate and Get User Info

[](#2-authenticate-and-get-user-info)

```
// After redirect, handle the callback
if (isset($_GET['code'])) {
    $token = $googleAuth->fetchAccessToken($_GET['code']);
    $user = $googleAuth->getUserInfo($token['access_token']);
    // Do something with $user
}
```

---

Configuration
-------------

[](#configuration)

OptionDescription`client_id`Google OAuth2 Client ID`client_secret`Google OAuth2 Client Secret`redirect_uri`Your App's Redirect URI---

API Reference
-------------

[](#api-reference)

MethodDescription`getAuthUrl()`Generates the Google OAuth2 authorization URL`fetchAccessToken()`Exchanges code for an access token`getUserInfo()`Retrieves authenticated user's information---

Contributing
------------

[](#contributing)

Contributions are welcome! Please open issues or submit pull requests for improvements or bug fixes.

---

License
-------

[](#license)

This project is licensed under the [MIT License](LICENSE).

---

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance39

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~67 days

Total

2

Last Release

767d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0491977a6415c27fea1d821fccaac0e6cf9429a446078ef6f5ab86f119d48c0f?d=identicon)[sadiq-bd](/maintainers/sadiq-bd)

---

Top Contributors

[![sadiq-bd](https://avatars.githubusercontent.com/u/72698818?v=4)](https://github.com/sadiq-bd "sadiq-bd (10 commits)")

### Embed Badge

![Health badge](/badges/sadiq-bd-google-auth/health.svg)

```
[![Health](https://phpackages.com/badges/sadiq-bd-google-auth/health.svg)](https://phpackages.com/packages/sadiq-bd-google-auth)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
