a6-plugin-basic-auth

Configure APISIX basic-auth on routes and consumers via a6 commands.

1|2|Updated Mar 6, 2026
One-click install
npx skills add https://github.com/api7/a6 --skill a6-plugin-basic-auth-api7
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: a6-plugin-basic-auth
Source: https://github.com/api7/a6/tree/main/skills/a6-plugin-basic-auth
Command: npx skills add https://github.com/api7/a6 --skill a6-plugin-basic-auth-api7

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides a straightforward way to secure APIs by using HTTP Basic Authentication, binding credentials to APISIX consumers, and applying protection at the route level.

Core Features & Use Cases

  • Bind credentials to consumers for route-level authentication
  • Support hide_credentials to prevent upstream credential leakage
  • Enable anonymous_consumer fallback with optional rate-limiting and clear behavior on unauthenticated requests
  • Integrate with a6 CLI to manage consumers and route plugins

Quick Start

Create a consumer, attach a basic-auth credential, apply the plugin on a route, and verify access with a basic-auth header.

Frequently Asked Questions about a6-plugin-basic-auth

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure APISIX basic-auth on routes and consumers?

Configure APISIX basic-auth by creating a consumer, attaching credentials, and binding the plugin to target routes via the Admin API or a6 CLI. This enforces route-level access control by validating submitted credentials against registered consumer profiles.

What is HTTP Basic Authentication and when do I need it for API access?

HTTP Basic Authentication secures API access by requiring a username and password in the request header. You need it when protecting API routes with simple credential binding to APISIX consumers without complex token generation or OAuth flows.

Can I hide credentials from upstream services using APISIX basic-auth?

Yes, APISIX basic-auth supports the hide_credentials option. Enabling this removes the authentication header from the request before forwarding it to upstream services, preventing credential leakage to backend systems.

How does anonymous_consumer work with APISIX basic-auth?

The anonymous_consumer feature provides a fallback for unauthenticated requests. It allows users without valid basic-auth credentials to access routes under a default identity, often paired with rate-limiting policies to restrict anonymous traffic behavior.

Does the a6 CLI support APISIX consumer management and plugin configuration?

Yes, the a6 CLI supports APISIX consumer management and route plugin configuration. You can use a6 commands to create consumers, attach basic-auth credentials, and apply plugin bindings to specific routes.

What are the limitations of using HTTP Basic Authentication for API routes?

HTTP Basic Authentication transmits credentials encoded in plaintext, requiring HTTPS to secure transit. It lacks token expiration and granular scope control, making it less suitable for complex authorization scenarios compared to JWT or OAuth mechanisms.