[Bug]: jwt-auth policy param authHeaderPrefix does not accept empty string ("")
Open
@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
- Configure the
jwt-authpolicy withheaderName: x-auth-keyandauthHeaderPrefix: "". - Send a request with
x-auth-key: <raw-jwt>(noBearerprefix). - Expected: raw token is validated and the request is authenticated.
- Actual: request is rejected with
401 invalid authorization header format— theBearerprefix is still enforced.
Severity Level of the Issue
Severity/Minor
Environment Details (with versions)
jwt-authpolicy v1.0.4- Platform-independent (configuration/logic issue)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.