@@ -3862,7 +3862,8 @@ namespace jwt {
3862
3862
using iterator = typename jwt_vector_t ::iterator;
3863
3863
using const_iterator = typename jwt_vector_t ::const_iterator;
3864
3864
3865
- JWT_CLAIM_EXPLICIT jwks (const typename json_traits::string_type& str) {
3865
+ template <typename Decode>
3866
+ jwks (const typename json_traits::string_type& str, Decode decode) {
3866
3867
typename json_traits::value_type parsed_val;
3867
3868
if (!json_traits::parse (parsed_val, str)) throw error::invalid_json_exception ();
3868
3869
@@ -3871,9 +3872,16 @@ namespace jwt {
3871
3872
3872
3873
auto jwk_list = jwks_json.get_claim (" keys" ).as_array ();
3873
3874
std::transform (jwk_list.begin (), jwk_list.end (), std::back_inserter (jwk_claims),
3874
- [](const typename json_traits::value_type& val) { return jwk_t { val} ; });
3875
+ [& ](const typename json_traits::value_type& val) { return jwk_t ( val, decode) ; });
3875
3876
}
3876
3877
3878
+ #ifndef JWT_DISABLE_BASE64
3879
+ JWT_CLAIM_EXPLICIT jwks (const typename json_traits::string_type& str)
3880
+ : jwks(str, [](const typename json_traits::string_type& str) {
3881
+ return base::decode<alphabet::base64url>(base::pad<alphabet::base64url>(str));
3882
+ }) {}
3883
+ #endif
3884
+
3877
3885
iterator begin () { return jwk_claims.begin (); }
3878
3886
iterator end () { return jwk_claims.end (); }
3879
3887
const_iterator cbegin () const { return jwk_claims.begin (); }
0 commit comments