PHPackages                             laragear/multi-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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. laragear/multi-auth

ActiveComposer-plugin[Authentication &amp; Authorization](/categories/authentication)

laragear/multi-auth
===================

Authenticate multiple Composer packages from the same host using different credentials.

v1.0.2(1mo ago)02MITPHPPHP ^8.3CI passing

Since Apr 29Pushed 1mo agoCompare

[ Source](https://github.com/Laragear/MultiAuth)[ Packagist](https://packagist.org/packages/laragear/multi-auth)[ Fund](https://paypal.me/darkghosthunter)[ Fund](https://www.buymeacoffee.com/darkghosthunter)[ RSS](/packages/laragear-multi-auth/feed)WikiDiscussions 1.x Synced 1w ago

READMEChangelog (3)Dependencies (4)Versions (6)Used By (0)

Laragear MultiAuth
==================

[](#laragear-multiauth)

[![Latest Version on Packagist](https://camo.githubusercontent.com/08522a66ffad8457755a5d3399a1ff13fc625cc7c3405144dcb2de1dea75ec23/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c617261676561722f6d756c74692d617574682e737667)](https://packagist.org/packages/laragear/multi-auth)[![Latest stable test run](https://github.com/Laragear/MultiAuth/actions/workflows/test.yml/badge.svg)](https://github.com/Laragear/MultiAuth/actions/workflows/test.yml)[![Codecov coverage](https://camo.githubusercontent.com/dca7235325e09cae021aa2881d20aa843ee5800fbb65f235384463e09927939f/68747470733a2f2f636f6465636f762e696f2f67682f4c617261676561722f4d756c7469417574682f67726170682f62616467652e7376673f746f6b656e3d564e733563614f4f7049)](https://codecov.io/gh/Laragear/MultiAuth)[![Maintainability](https://camo.githubusercontent.com/5117490a87696997fadb585002ece13fc9b5e92191e41aa9ff05e15bf8ba3049/68747470733a2f2f716c74792e73682f67682f4c617261676561722f70726f6a656374732f4d756c7469417574682f6d61696e7461696e6162696c6974792e737667)](https://qlty.sh/gh/Laragear/projects/MultiAuth)

Authenticate multiple Composer packages from the same host using different credentials.

```
composer multi-auth:config laragear/web-checkout license ABC-123
```

Why this package?
-----------------

[](#why-this-package)

Composer natively associates authentication credentials (like HTTP Basic, Bearer tokens, GitHub OAuth) with a single **domain** inside the `auth.json` file. If you have a private package registry serving multiple packages under the same domain (e.g. `keygen.sh` or `github.com`), you cannot easily use different credentials for different packages.

This plugin allows you to define authentication credentials **per-package**, overriding the default domain-based authentication, plus two useful authentication mechanisms:

```
{
    "http-basic": {
        "...": "..."
    },
    "laragear/web-checkout": {
        "license": "$WEBCHECKOUT_LICENSE"
    }
}
```

Become a sponsor
----------------

[](#become-a-sponsor)

[![](.github/assets/support.png)](https://github.com/sponsors/DarkGhostHunter)

Your support allows me to keep this package free, up-to-date, and maintainable. Alternatively, you can **[spread the word!](http://x.com/share?text=I%20am%20using%20this%20cool%20PHP%20package&url=https://github.com%2FLaragear%2FMultiAuth&hashtags=PHP,Composer)**

Requirements
------------

[](#requirements)

- PHP 8.3 or later.
- Composer 2.0 or later.

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

[](#installation)

Require this package globally or into your project using Composer:

```
composer require global laragear/multi-auth
```

Important

If you require this in your project, the plugin will be active only for a single Composer project.

Usage
-----

[](#usage)

Instead of manually editing your `auth.json` file, use the provided `multi-auth:config` command. The command accepts the package name, the authentication type, and the required credentials:

### Authentication Types

[](#authentication-types)

The following authentication types are supported:

#### HTTP Basic

[](#http-basic)

Standard HTTP Basic authentication.

```
composer multi-auth:config vendor/package http-basic username password
```

#### Bearer Token

[](#bearer-token)

Standard Authorization Bearer token.

```
composer multi-auth:config vendor/package bearer my-secret-token
```

#### GitHub / GitLab

[](#github--gitlab)

Token-based authentication for GitHub or Gitlab.

```
composer multi-auth:config vendor/package github-oauth my-github-token
composer multi-auth:config vendor/package gitlab-oauth my-gitlab-token
composer multi-auth:config vendor/package gitlab-token my-gitlab-private-token
```

#### License Key

[](#license-key)

Adds a custom `Authentication: License ` header.

```
composer multi-auth:config vendor/package license ABC-123-XYZ
```

#### Custom Query Parameters

[](#custom-query-parameters)

You can append custom query parameters to the package download URL. This is especially useful for passing tokens as URL parameters.

```
composer multi-auth:config vendor/package query auth "license:\$TOKEN"
```

This will automatically append `?auth=license:{TOKEN}` to the URL when Composer downloads `vendor/package`, where `{TOKEN}` is automatically resolved from your environment variables.

### Global Configuration

[](#global-configuration)

If you want to apply the configuration globally across all your Composer projects, append the `--global` (or `-g`) flag.

```
composer multi-auth:config vendor/package license ABC-123 --global
```

Note

This will only work if Multiauth was [installed globally](#installation).

Environment Variables
---------------------

[](#environment-variables)

You can use environment variables in any of your credentials too! Prefix the variable name with a `$` sign. Append `\` to avoid the shell replacing the variable name with an environment value.

```
composer multi-auth:config vendor/package bearer \$MY_SECRET_TOKEN
```

When Composer downloads the package, the plugin will automatically resolve `$MY_SECRET_TOKEN` from your current environment.

Security
--------

[](#security)

If you discover any security-related issues, please email  instead of using the issue tracker.

License
-------

[](#license)

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

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance92

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity52

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

Total

4

Last Release

41d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5141911?v=4)[Italo](/maintainers/DarkGhostHunter)[@DarkGhostHunter](https://github.com/DarkGhostHunter)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/laragear-multi-auth/health.svg)

```
[![Health](https://phpackages.com/badges/laragear-multi-auth/health.svg)](https://phpackages.com/packages/laragear-multi-auth)
```

###  Alternatives

[symfony/runtime

Enables decoupling PHP applications from global state

74694.9M933](/packages/symfony-runtime)[phpro/grumphp

A composer plugin that enables source code quality checks.

4.3k16.3M972](/packages/phpro-grumphp)[drupal/core-composer-scaffold

A flexible Composer project scaffold builder.

5344.1M525](/packages/drupal-core-composer-scaffold)[drupal/core-project-message

Adds a message after Composer installation.

2124.0M192](/packages/drupal-core-project-message)[phpro/grumphp-shim

GrumPHP Phar distribution

284.6M333](/packages/phpro-grumphp-shim)[drupal/core-vendor-hardening

Hardens the vendor directory for when it's in the docroot.

174.7M40](/packages/drupal-core-vendor-hardening)

PHPackages © 2026

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