Skip to content

authn-jwt-gitlab does not seem to be explicitly handling 401 Unauthorized errors #14

@cmellazchy

Description

@cmellazchy

Describe the bug
The authn-jwt-gitlab binary does not explicitly handle 401 Unauthorized errors. Instead, it fails during secret retrieval and returns a JSON parsing error (example below), which does not clearly indicate to the user that the issue is authentication related.

2025/04/01 13:03:41 Cannot retrieve secret value for path/to/variable/username. Unable to unmarshal token : unexpected end of JSON input

To Reproduce
Steps to reproduce the behavior:

  1. Follow the steps in the README to create a sample configuration.
  2. Use incorrect JWT authentication information, such as an invalid service ID.
  3. Observe that the error message indicates a JSON parsing issue rather than an authentication failure.

Expected behavior
A clear error message should be displayed, referring to the authentication failure due to invalid credentials or unauthorized access.

Additional context
This issue makes it difficult for users to diagnose authentication problems, leading to confusion when troubleshooting.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions