prometheus / prometheus/common

Feature request: Add client_assertion field for oauth2 jwt-bearer grant type

Open
#869 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
295
Forks
367
Avg merge
2d 10h
Merged PRs (30d)
18

Description

The current OAuth2 configuration in the config package supports client_id and client_secret (either as strings or files).
Since PR #862, it also supports the Authorization Grant flow, where a private key can be used to sign a JWT.

It would be great if we could extend the OAuth2 struct to include client_assertion and client_assertion_file fields. This would enable users to manually provide a signed JWT when needed.

While the library can generate the signed JWT itself, there are cases where the client_assertion is created externally—such as by a sidecar, a specialized KMS, or a separate job—and then injected into the application as a file or environment variable. Currently, there's no built-in way to pass this parameter directly.

Contributor guide

Open the contributing guide

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.

Research direction

Start in the config package by locating the OAuth2 struct and the existing client_id and client_secret string-or-file handling. Trace how the Authorization Grant flow consumes these settings, then add coverage in the relevant config tests for directly supplied and file-based client assertions; done means both values can be provided and used for the JWT-bearer grant.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
authentication
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.