Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

Fix: use jwks_uri from OIDC metadata for JWKS client (#8136)

yurhett9c6c6c51e0c3
diff --git a/api/apps/auth/oidc.py b/api/apps/auth/oidc.py
index 2fcdb6f5d0..9c59ffaeba 100644
--- a/api/apps/auth/oidc.py
+++ b/api/apps/auth/oidc.py
@@ -68,8 +68,7 @@ class OIDCClient(OAuthClient):
alg = headers.get("alg", "RS256")
# Use PyJWT's PyJWKClient to fetch JWKS and find signing key
- jwks_url = f"{self.issuer}/.well-known/jwks.json"
- jwks_cli = jwt.PyJWKClient(jwks_url)
+ jwks_cli = jwt.PyJWKClient(self.jwks_uri)
signing_key = jwks_cli.get_signing_key_from_jwt(id_token).key
# Decode and verify signature