Skip to content

Commit

Permalink
Update DiscoveryDocumentCachingSigningKeyProvider.cs
Browse files Browse the repository at this point in the history
Call blocking method RetrieveMetadata() in provider constructor, instead of non-blocking caching method RefreshMetadata(). Ensures that construction of the provider causes a fetch of signing keys on the backchannel, eliminates race conditions that lead to 401 Unauthorized responses on cold start.  Fixes okta#249 and okta#243
  • Loading branch information
pixelnix authored Dec 11, 2023
1 parent 9c9dbb3 commit 848a6c3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Okta.AspNet/DiscoveryDocumentCachingSigningKeyProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ internal class DiscoveryDocumentCachingSigningKeyProvider
public DiscoveryDocumentCachingSigningKeyProvider(IDiscoveryDocumentSigningKeyProvider provider)
{
_discoveryDocumentSigningKeyProvider = provider ?? throw new ArgumentNullException(nameof(provider), "The provider cannot be null.");
RefreshMetadata();
RetrieveMetadata();
}

/// <summary>
Expand Down

0 comments on commit 848a6c3

Please sign in to comment.