Open diwu-sf opened 3 weeks ago
# Authenticate request using Clerk SDK
auth_state: RequestState = clerk_client.authenticate_request(
httpx_request,
AuthenticateRequestOptions(
jwt_key=settings.CLERK_JWT_KEY,
),
)
Providing JWT key upfront helps for me. Can be found in API Keys page of the Clerk dashboard
authenticate_request
seem to fetch the jwks repeatedly (functionfetch_jwks
) to find the right public key.is it possible to have this cache the public key instead of doing network calls on every authenticate request call? We use
authenticate_request
as part of our authentication middleware so every API call will trigger this.