Download the PHP package hryvinskyi/composer-multi-auth without Composer

On this page you can find all versions of the php package hryvinskyi/composer-multi-auth. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package composer-multi-auth

Composer Multi-Auth

Composer plugin that enables per-package HTTP basic authentication on a single repository domain.

Problem

Composer resolves HTTP basic auth by domain — one credential pair per domain in auth.json. When a single repository hosts packages from different vendors requiring different API keys, there's no native way to use per-package credentials.

How It Works

The plugin reads auth-multi.json from your project root and:

  1. Overrides default auth with the first rule's credentials during repository metadata discovery (so the provider listing includes all packages you need).
  2. Intercepts each download via Composer's PRE_FILE_DOWNLOAD event and applies the correct credentials based on package name glob patterns.
  3. Restores default credentials for packages that don't match any specific rule.

First matching rule wins. Use * as a catch-all.

Requirements

Installation

Add to allow-plugins in your composer.json if prompted:

Setup

On first activation the plugin automatically:

Then create your config:

  1. Copy the sample and fill in your keys:

  2. Edit auth-multi.json:

Configuration

auth-multi.json

Field Description
http-basic Top-level key (matches Composer's auth.json structure)
<domain> Repository domain
rules Ordered array of rules — first match wins
patterns Array of glob patterns matched via fnmatch() (e.g., vendor/*, vendor/package)
username HTTP basic auth username / public key
password HTTP basic auth password / private key

Rule ordering

Rules are evaluated top-to-bottom. The first rule whose patterns match the package name is used. Always place specific rules before the catch-all * rule.

Catch-all rule

The catch-all rule ("patterns": ["*"]) should be the last rule and should contain your default auth.json credentials. This ensures packages not matching any specific rule still authenticate correctly.

Important: The first rule's credentials are used for repository metadata discovery (loading the package listing). Place the rule for the packages you need to discover first.

Verification

Run Composer with verbose output to see the plugin in action:

Look for [multi-auth] prefixed messages:

License

MIT


All versions of composer-multi-auth with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
composer-plugin-api Version ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package hryvinskyi/composer-multi-auth contains the following files

Loading the files please wait ...