PHPackages                             douglasresendemaciel/oauth2-client - 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. douglasresendemaciel/oauth2-client

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

douglasresendemaciel/oauth2-client
==================================

OAUTH2 client for laravel

09423PHP

Since Oct 13Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/douglasresendemaciel/oauth2-client)[ Packagist](https://packagist.org/packages/douglasresendemaciel/oauth2-client)[ RSS](/packages/douglasresendemaciel-oauth2-client/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

OAuth2 client for LARAVEL
=========================

[](#oauth2-client-for-laravel)

This package is used to consume OAuth2 API´s from Laravel

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

[](#installation)

Run the following command from you terminal:

```
composer require "douglasresendemaciel/oauth2-client:@dev"
```

or add this to require section in your composer.json file:

```
"douglasresendemaciel/oauth2-client"

```

then run `composer update`

Once it is installed, you need to register the service provider. Open up config/app.php and add the following to the providers key.

```
'providers' => [
...
DouglasResende\OAuth2Client\OAuth2ClientServiceProvider::class
...
```

Publishing config file

```
php artisan vendor:publish
```

Usage
-----

[](#usage)

```
$oauth2Client = new \DouglasResende\OAuth2Client\OAuth2Client();

# METHODS TO GET TOKEN // https://laravel.com/docs/5.7/passport

// authorization_code
$oauth2 = $oauth2Client->withOAuthTokenTypeAuthorizationCode('client-id', 'client-secret', 'redirect-url', 'code');

// client_credentials
$oauth2 = $oauth2Client->withOAuthTokenTypeClientCredentials('client-id', 'client-secret','scope');

// password
$oauth2 = $oauth2Client->withOAuthTokenTypePassword('client-id', 'client-secret', 'username', 'password', 'scope');

// GET RESPONSE
$response = $oauth2Client->get("user")->getResponseAsArray();
```

Author
------

[](#author)

Douglas Resende:

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

References
----------

[](#references)

For more information read the official documentation at

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance54

Moderate activity, may be stable

Popularity18

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity20

Early-stage or recently created project

 Bus Factor1

Top contributor holds 69.8% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/34d28941a36733330db0c19c87dee6d9e6c84c55487398d6a23870fdc98a9651?d=identicon)[douglasresendemaciel](/maintainers/douglasresendemaciel)

---

Top Contributors

[![douglasresendemaciel](https://avatars.githubusercontent.com/u/11336192?v=4)](https://github.com/douglasresendemaciel "douglasresendemaciel (30 commits)")[![nocartorio-douglas-resende](https://avatars.githubusercontent.com/u/204616479?v=4)](https://github.com/nocartorio-douglas-resende "nocartorio-douglas-resende (5 commits)")[![spelcaster](https://avatars.githubusercontent.com/u/3278419?v=4)](https://github.com/spelcaster "spelcaster (5 commits)")[![samuel-lucas-nocartorio](https://avatars.githubusercontent.com/u/204731754?v=4)](https://github.com/samuel-lucas-nocartorio "samuel-lucas-nocartorio (3 commits)")

### Embed Badge

![Health badge](/badges/douglasresendemaciel-oauth2-client/health.svg)

```
[![Health](https://phpackages.com/badges/douglasresendemaciel-oauth2-client/health.svg)](https://phpackages.com/packages/douglasresendemaciel-oauth2-client)
```

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[league/oauth2-google

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

41721.2M118](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)

PHPackages © 2026

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