wso2 / wso2/api-platform

[Bug]: jwt-auth policy param authHeaderPrefix does not accept empty string ("")

Open
#2,110 0 comments 0 reactions 1 assignee View on GitHub

@Krishanx92 is already working on this.

Since Jun 8, 2026.

Area/Policies Aspect/Configuration Severity/Minor Type/Bug
Dominant language
Go
Stars
71
Forks
111
Avg merge
1d 14h
Merged PRs (30d)
110

Description

Please select the area the issue is related to

Area/Policies

Please select the aspect the issue is related to

Aspect/Configuration

Description

In the jwt-auth policy, an empty string works at the system parameter level (authHeaderScheme: "") to disable the scheme prefix and accept a raw token. But the equivalent policy user parameter authHeaderPrefix: "" is silently ignored, and the policy keeps enforcing the default Bearer prefix.

So there is no way for a policy user to configure "no scheme prefix" via authHeaderPrefix.

Steps to Reproduce
  1. Configure the jwt-auth policy with headerName: x-auth-key and authHeaderPrefix: "".
  2. Send a request with x-auth-key: <raw-jwt> (no Bearer prefix).
  3. Expected: raw token is validated and the request is authenticated.
  4. Actual: request is rejected with 401 invalid authorization header format — the Bearer prefix is still enforced.
Severity Level of the Issue

Severity/Minor

Environment Details (with versions)
  • jwt-auth policy v1.0.4
  • Platform-independent (configuration/logic issue)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.