In this post, we will discuss a few issues, and their solutions, when working with asymmetrically signed JWTs (JSON Web Tokens). The post assumes you have a basic working knowledge of JWTs. The Lowdown (Intro) When working with JWTs (JSON Web Tokens)...

Markdown supported · ⌘↵ to post
Using
force: true, skip_nil: truedoes not work the way you described it in:
The cache will be cleared even if the response is not successful and fetch_jwks returns nil.
Rails.cache.fetch("JWKS_CACHE_KEY", force: true, skip_nil: true) do Time.now.to_s end => "2021-08-31 11:22:32 +0200" Rails.cache.fetch("JWKS_CACHE_KEY", force: true, skip_nil: true) do nil end => nil Rails.cache.fetch("JWKS_CACHE_KEY") => nil