# `PaperTiger.Plugs.Auth`
[🔗](https://github.com/EnaiaInc/paper_tiger/blob/v1.2.2/lib/paper_tiger/plugs/auth.ex#L1)

Authenticates requests using Stripe-compatible API key verification.

## Authentication Modes

- **Lenient (default)** - Accepts any non-empty Authorization header
- **Strict** - Validates key format (sk_test_*, sk_live_*)

## Usage

    # In router
    plug PaperTiger.Plugs.Auth
    plug PaperTiger.Plugs.Auth, mode: :strict

## Stripe Authentication Format

Stripe uses HTTP Basic Auth with the API key as the username:

    Authorization: Bearer sk_test_abc123
    # or
    Authorization: Basic c2tfdGVzdF9hYmMxMjM6  (base64 of "sk_test_abc123:")

## Error Response

    {
      "error": {
        "type": "invalid_request_error",
        "message": "You did not provide an API key..."
      }
    }

---

*Consult [api-reference.md](api-reference.md) for complete listing*
