PHPackages                             hamidatyabi/auth2 - 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. hamidatyabi/auth2

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

hamidatyabi/auth2
=================

Provides authorization api

1.0.2(6y ago)025[2 PRs](https://github.com/hamidatyabi/oauth2-client-php/pulls)MITPHP

Since Nov 18Pushed 3y ago1 watchersCompare

[ Source](https://github.com/hamidatyabi/oauth2-client-php)[ Packagist](https://packagist.org/packages/hamidatyabi/auth2)[ RSS](/packages/hamidatyabi-auth2/feed)WikiDiscussions master Synced today

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

oauth2-client-php
=================

[](#oauth2-client-php)

You can use this library for connect to your authentication server

Login and get new token
=======================

[](#login-and-get-new-token)

You can send username and password and get new token

```
$config = array(
    "oauth2_host" => "localhost",
    "oauth2_port" => "port",
    "oauth2_client_id" => "client_id",
    "oauth2_client_secret" => "client_secret"
);
$client = new \HamidAtyabi\OAuth2Client\AccessToken\AccessToken($config);
$result = $client->get("username", "password");
```

Check your AccessToken
======================

[](#check-your-accesstoken)

You can check access\_token validity with server

```
$config = array(
    "oauth2_host" => "localhost",
    "oauth2_port" => "port",
    "oauth2_client_id" => "client_id",
    "oauth2_client_secret" => "client_secret"
);
$client = new \HamidAtyabi\OAuth2Client\AccessToken\AccessToken($config);
$result = $client->validity("access_token");
```

Refresh your token
==================

[](#refresh-your-token)

You can refresh your token by refresh\_token

```
$config = array(
    "oauth2_host" => "localhost",
    "oauth2_port" => "port",
    "oauth2_client_id" => "client_id",
    "oauth2_client_secret" => "client_secret"
);
$client = new \HamidAtyabi\OAuth2Client\RefreshToken\RefreshToken($config);
$result = $client->refresh("refresh_token");
```

Get user details information
============================

[](#get-user-details-information)

You can get details of user information

```
$config = array(
    "oauth2_host" => "localhost",
    "oauth2_port" => "port",
    "oauth2_client_id" => "client_id",
    "oauth2_client_secret" => "client_secret"
);
$client = new \HamidAtyabi\OAuth2Client\User\User($config);
$result = $client->get("access_token");
```

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

Established project with proven stability

 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 ~0 days

Total

2

Last Release

2419d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3f54844715b50e78cc1497c221d5fbda8c96b911aabe966cac1d06a77dcba0f4?d=identicon)[hamidatyabi](/maintainers/hamidatyabi)

---

Top Contributors

[![hamidatyabi](https://avatars.githubusercontent.com/u/36162354?v=4)](https://github.com/hamidatyabi "hamidatyabi (4 commits)")

---

Tags

Authenticationoauthoauth2authorization

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/hamidatyabi-auth2/health.svg)

```
[![Health](https://phpackages.com/badges/hamidatyabi-auth2/health.svg)](https://phpackages.com/packages/hamidatyabi-auth2)
```

###  Alternatives

[league/oauth2-client

OAuth 2.0 Client Library

3.8k128.7M1.3k](/packages/league-oauth2-client)[ellaisys/aws-cognito

Laravel Authentication using AWS Cognito (Web and API)

123256.9k1](/packages/ellaisys-aws-cognito)[calcinai/oauth2-xero

Xero OAuth 2.0 Client Provider for The PHP League OAuth2-Client

103.4M4](/packages/calcinai-oauth2-xero)[chervand/yii2-oauth2-server

OAuth 2.0 server for Yii 2.0 with MAC tokens support.

1524.7k1](/packages/chervand-yii2-oauth2-server)

PHPackages © 2026

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