Skip to content

OAuth: factory methods in JwtDecoders does not allow changing timeout #9904

Closed
@IsSkyfalls

Description

@IsSkyfalls

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 RemoteJWKSetwith only the jwkSetURLparameter. 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?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions