Expected Behavior
OidcIdTokenDecoderFactory when used with a JWKs doesn't provide any option to configure the RestOperations used by the NimbusJwtDecoder when fetching the JWKs. I expected to be able to provide an instance of my own.
Current Behavior
RestOperations uses the hard-coded default of a new RestTemplate() created in JwkSetUriJwtDecoderBuilder without any user-settable option.
Context
My concrete context was to selectively set a proxy, but I can easily image user reasons to modify the RestOperations being used. I ended up providing a JwtDecoderFactory of my own that more or less contained a copy of OidcIdTokenDecoderFactory.
I will create a PR modelled after the way RestOperations are configurable in DefaultAuthorizationCodeTokenResponseClient.
Comment From: eleftherias
Thanks for reaching out @bodewig. This looks like a duplicate of gh-10334. Feel free to take a look at the comments on that issue and see if you are in the same situation.
Comment From: bodewig
I'm pretty sure I looked for existing issues, but likely I didn't search the closed ones.
You are correct, this is a duplicate of #10334 so I will close it. I will comment over there as don't believe my workaround
I ended up providing a JwtDecoderFactory of my own that more or less contained a copy of OidcIdTokenDecoderFactory.
really is a good option.