PHPackages                             dormilich/http-oauth-bundle - 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. dormilich/http-oauth-bundle

ActiveSymfony-bundle[Authentication &amp; Authorization](/categories/authentication)

dormilich/http-oauth-bundle
===========================

Symfony 5 bundle for dormilich/http-oauth.

02PHP

Since Aug 16Pushed 4y ago1 watchersCompare

[ Source](https://github.com/Dormilich/http-oauth-bundle)[ Packagist](https://packagist.org/packages/dormilich/http-oauth-bundle)[ RSS](/packages/dormilich-http-oauth-bundle/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

http-oauth bundle
=================

[](#http-oauth-bundle)

Symfony 5 bundle for `dormilich/http-oauth`, which is an extension to `dormilich/http-client`with the purpose of adding OAuth 2.0 authorisation to request that require them. Requests that do not require authorisation (resp. lack authorisation credentials) are run without authorisation.

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

[](#installation)

This bundle requires Symfony 5 as well as a [PSR-16](https://www.php-fig.org/psr/psr-16/), [PSR-17](https://www.php-fig.org/psr/psr-17/), and [PSR-18](https://www.php-fig.org/psr/psr-18/)implementation.

- [PSR-16 libraries](https://packagist.org/providers/psr/simple-cache-implementation)
- [PSR-17 libraries](https://packagist.org/providers/psr/http-factory-implementation)
- [PSR-18 libraries](https://packagist.org/providers/psr/http-client-implementation)

However, it makes sense to use `symfony/cache` as PSR-16 and `symfony/http-client` as PSR-18 implementation in a Symfony project.

You can then install this bundle via composer:

```
composer require dormilich/http-oauth-bundle

```

To set up `dormilich/http-client`, also install `dormilich/http-client-bundle`.

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

[](#configuration)

The configuration is the standard way to set up the OAuth credentials. Without adding at least one type of credentials the authorisation will be ignored.

### Single set of credentials for all requests

[](#single-set-of-credentials-for-all-requests)

The most simple setup is when you only have a single set of credentials. This will be used on every request done with the HTTP client (even when no authorisation is required).

```
# note that the actual credentials should be loaded from the environment
dormilich_http_oauth:
  credentials:
    default:
      client: '%env(CLIENT_ID)%'
      secret: '%env(CLIENT_SECRET)%'
      server: https://example.com/oauth/token
```

### Credentials for specific resource domains

[](#credentials-for-specific-resource-domains)

This is for associating a set of credentials with a set of specific domains (using Google APIs for demonstration). Other requests will not get an Authorization header added.

```
# this will only add authorisation to requests to googleapis.com (and its subdomains)
dormilich_http_oauth:
  credentials:
    domains:
      - client: '%env(CLIENT_ID)%'
        secret: '%env(CLIENT_SECRET)%'
        server: https://example.com/oauth/token
        hosts: googleapis.com
```

### Custom credentials strategy

[](#custom-credentials-strategy)

If neither of these configuration strategies match your case, then you can create your own credentials provider by creating a class that implements `CredentialsProviderInterface`. To make the extension use this provider, redefine the `CredentialsProviderInterface` service with your class.

```
# services.yaml
services:
  Dormilich\HttpOauth\Credentials\CredentialsProviderInterface:
    class: App\CustomCredentialsProvider
```

Alternatively, or if you need to use multiple providers, it suffices to tag these providers. This also works in combination with configured providers.

```
# services.yaml
services:
  App\CustomCredentialsProvider:
    tags: dormilich_http_oauth.credentials
```

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity28

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/392135?v=4)[Bertold von Dormilich](/maintainers/Dormilich)[@Dormilich](https://github.com/Dormilich)

---

Top Contributors

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

---

Tags

composersymfony-bundle

### Embed Badge

![Health badge](/badges/dormilich-http-oauth-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/dormilich-http-oauth-bundle/health.svg)](https://phpackages.com/packages/dormilich-http-oauth-bundle)
```

###  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)
