Description
Expected Behavior
Factory methods in JwtDecoders should accept timeout values to pass into RemoteJWKSet.
Current Behavior
Well, it doesn't allow this.
Problem:
JwtDecoders
has 2 factory methods, fromIssuerLocation
and withProviderConfiguration
. Which both initialize RemoteJWKSet
with only the jwkSetURL
parameter. Because the resourceRetriever
parameter is not set, it initializes with the default timeouts which are 500ms for both http_read and http_connect. Only 1 second is a bit short and just fail on my slow school wifi because SSL handshake took 2 seconds on its own.
Solution:
I could just stop using JwtDecoders
and create JwtDecoder
myself. This is like 15 lines of boilerplate code. But I think this should be customizable in JwtDecoders
. The thing is, based on the current design(factory methods), I really couldn't find a proper place to pass in RemoteJWKSet
or its parameters. Maybe a builder pattern is more appropriate in this situation?