Open nov opened 2 years ago
I wanted to check on the status of this. I know the PR is a bit out of date. Is there a plan to incorporate something like this? Caching the public keys with a configurable cache so we don't hit our jwks_uri on every verification would be very helpful for a project I am working on.
OpenIDConnect::ResponseObject::IdToken.decode
now acceptsOpenIDConnect::Discovery::Provider::Config::Response
instead ofkey
. https://github.com/nov/openid_connect/blob/master/spec/openid_connect/response_object/id_token_spec.rb#L254-L300then fetch JWK specified by the ID Token
kid
header fromjwks_uri
usingJSON::JWK::Set::Fetcher
. https://github.com/nov/openid_connect/blob/master/lib/openid_connect/response_object/id_token.rb#L70-L73 https://github.com/nov/openid_connect/blob/master/lib/openid_connect/discovery/provider/config/response.rb#L90-L93and
JSON::JWK::Set::Fetcher
has JWKS caching feature. https://github.com/nov/json-jwt/wiki/JWK-Set#fetchingso, once
omniauth_openid_connect
gem users specify like this, this gem start caching JWKS bykid
.ps. you might want to support caching option via omniauth config?