Some OIDC providers (Microsoft) do not have spec-compliant discovery documents, and require patching in order to fully validate tokens.
Relevant code I found from a quick skim:
Perhaps some sort of middleware step that lets the user define a post-fetch function that operates on the document?
Example of another OIDC library's implementation of document overrides: