Skip to content

Add configuration option to require explicit authentication method specification #25184

Closed

Description

@omarkj

Search before reporting

  • I searched in the issues and found nothing similar.

Motivation

Currently, when a client connects to a Pulsar broker without specifying an authentication method (via the X-Pulsar-Auth-Method-Name header in HTTP or the auth method field in the Pulsar protocol), the broker attempts to authenticate using all configured authentication providers sequentially until one succeeds or all fail.

While this fallback behaviour provides flexibility, it can create security concerns in deployments where operators want to enforce that clients must explicitly specify which authentication method they're using. This explicit requirement helps prevent:

  1. Unintended authentication against the wrong provider
  2. Ambiguity about which authentication mechanism was actually used
  3. Potential security issues where fallback behaviour differs from operator expectations

Solution

Add a new broker configuration option strictAuthMethod (default: false) that, when enabled, requires clients to explicitly specify their authentication method. When enabled:

  • Authentication requests without an explicit method will immediately fail with an "Authentication method missing" error
  • Clients must specify which authentication provider they intend to use
  • No fallback to trying multiple providers will occur

This provides operators with better control over authentication behaviour in security-sensitive deployments while maintaining backward compatibility through the default false value.

Alternatives

No, this is an additive feature that doesn't change existing behaviour when disabled.

Anything else?

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Activity

  1. added
    type/enhancement
    on Jan 26, 2026
  2. merlimat commented on Oct 23, 2026

    @merlimat
    Contributor

    Thanks @omarkj for the proposal. This was implemented by #25185, which adds the strictAuthMethod broker setting (default false). When it is enabled, a request that does not name an authentication method fails instead of trying each configured provider. It is in 4.2.0 and was also released in 4.0.9 and 4.1.3. If something here is still missing on a currently supported release, please reopen or open a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions