Support OIDC Token introspection

Description

User Story

As a security administrator,

I want to validate OIDC tokens against an identity provider,

So that I can ensure only valid and non-expired tokens are used for authentication.

Problem Description

Without token validation, Percona Server for MongoDB could accept expired or invalid tokens, leading to security vulnerabilities.

Acceptance Criteria

  • The server verifies OIDC token signature and claims.

  • Token introspection follows the OpenID Connect specification.

  • Invalid or expired tokens result in authentication failure.

  • Public keys (JWKS) should be fetched dynamically from the IdP's OIDC discovery URL.

Out of scope

  • OIDC token permission check - in other words - The server doesn’t verify and map claims into user roles. We can assume it is always the grands Admin role or maps a hardcoded claim role.

  • Testing (QA verification) at this stage

Design / Solution Proposal

  • Use JWT libraries to validate token signatures and claims (e.g., expiration, issuer, audience):

    • 🔹 When a user provides an OIDC token, verify it using jwt-cpp:

      1. Extract token from the request header or authentication payload.

      2. Decode and validate JWT structure:

        • Check the issuer (iss) matches the configured OIDC provider.

        • Validate the audience (aud) to ensure the token was issued for MongoDB.

        • Check expiration (exp) and not-before (nbf) claims.

      3. Verify JWT signature using the public key (JWKS) fetched from the OIDC provider.

  • Introduce a configuration flag for token introspection.

  • Ensure the identity provider’s public keys (JWKS) are fetched and used for verification.

Environment

None

split to

Activity

Konstantin Trushin 
April 14, 2025 at 10:02 AM

The task is split into two ones

Konstantin Trushin 
April 8, 2025 at 12:49 PM

Issue split into:

OIDC: verify JWT signature

OIDC: verify JWT claims

radoslaw.szulgo 
April 3, 2025 at 1:18 PM

See the comment there - it might not necessarily be needed

Roshan Swain 
April 3, 2025 at 1:16 PM

Hi , sorry I didn’t see any notifications on this so pardon for late response.

Yes, I would love to pick one of those. I will start looking on the . Thanks

radoslaw.szulgo 
March 20, 2025 at 5:24 PM

Hi ! Nice to meet you. It’s really nice you’d like to contribute and help us. We plan to start this particular task soon, and as it’s critical, we’ll take it on our side. Maybe you’d like to contribute to other tasks such as: or ?

Done

Details

Assignee

Reporter

Labels

Needs QA

Smart Checklist Progress

Priority

Created February 10, 2025 at 1:02 PM
Updated April 14, 2025 at 10:07 AM
Resolved April 14, 2025 at 10:02 AM