diff --git a/jose/jws.py b/jose/jws.py
index 293b32a..f1b1d1a 100644
--- a/jose/jws.py
+++ b/jose/jws.py
@@ -225,7 +225,7 @@ def _sig_matches_keys(keys, signing_input, signature, alg):
 def _get_keys(key):
 
     try:
-        key = json.loads(key)
+        key = json.loads(key, parse_int=str, parse_float=str)
     except Exception:
         pass
 

Various issues in jwt.decode / jws._get_keys
I've had a couple issues (figuring out how to use jwt.decode) which stem from the jws._get_keys implementation.

1. key argument must be iterable- raises exception otherwise
2. string key argument must not contain 'keys' (ie if a PEM base64 segment or HS secret segment contains keys, it'll break)
3. key can't be the result of calling jwk.construct (usability issue)
4. attempting json.loads on anything not a string seems weird



diff --git a/tests/test_jwt.py b/tests/test_jwt.py
index 03f5c28..0c599ca 100644
--- a/tests/test_jwt.py
+++ b/tests/test_jwt.py
@@ -52,6 +52,13 @@ class TestJWT:
                 key=key,
                 algorithms=[])
 
+    @pytest.mark.parametrize("key, token",
+                             [('1234567890', u'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoidGVzdCJ9.aNBlulVhiYSCzvsh1rTzXZC2eWJmNrMBjINT-0wQz4k'),
+                              ('123456789.0',u'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoidGVzdCJ9.D8WLFPMi3yKgua2jm3BKThFsParXpgxhIbsUc39zJDw')])
+    def test_numeric_key(self, key, token):
+        token_info = jwt.decode(token, key)
+        assert token_info == {"name": "test"}
+
     def test_invalid_claims_json(self):
         old_jws_verify = jws.verify
         try:

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest pytest-cov
3.9
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
coverage==7.8.0
ecdsa==0.14.1
exceptiongroup==1.2.2
iniconfig==2.1.0
packaging==24.2
pluggy==1.5.0
pyasn1==0.6.1
pycryptodome==3.22.0
pytest==8.3.5
pytest-cov==6.0.0
-e git+https://github.com/mpdavis/python-jose.git@99ec142374a6eb98e32be5b8cdfd72508fd404d4#egg=python_jose
rsa==4.9
six==1.17.0
tomli==2.2.1

name: python-jose
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - coverage==7.8.0
      - ecdsa==0.14.1
      - exceptiongroup==1.2.2
      - iniconfig==2.1.0
      - packaging==24.2
      - pluggy==1.5.0
      - pyasn1==0.6.1
      - pycryptodome==3.22.0
      - pytest==8.3.5
      - pytest-cov==6.0.0
      - rsa==4.9
      - six==1.17.0
      - tomli==2.2.1
prefix: /opt/conda/envs/python-jose

tests/test_jwt.py::TestJWT::test_numeric_key[1234567890-eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoidGVzdCJ9.aNBlulVhiYSCzvsh1rTzXZC2eWJmNrMBjINT-0wQz4k] tests/test_jwt.py::TestJWT::test_numeric_key[123456789.0-eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoidGVzdCJ9.D8WLFPMi3yKgua2jm3BKThFsParXpgxhIbsUc39zJDw]
tests/test_jwt.py::TestJWT::test_no_alg tests/test_jwt.py::TestJWT::test_invalid_claims_json tests/test_jwt.py::TestJWT::test_invalid_claims tests/test_jwt.py::TestJWT::test_non_default_alg tests/test_jwt.py::TestJWT::test_non_default_alg_positional_bwcompat tests/test_jwt.py::TestJWT::test_no_alg_default_headers tests/test_jwt.py::TestJWT::test_non_default_headers tests/test_jwt.py::TestJWT::test_deterministic_headers tests/test_jwt.py::TestJWT::test_encode tests/test_jwt.py::TestJWT::test_decode tests/test_jwt.py::TestJWT::test_leeway_is_int tests/test_jwt.py::TestJWT::test_leeway_is_timedelta tests/test_jwt.py::TestJWT::test_iat_not_int tests/test_jwt.py::TestJWT::test_nbf_not_int tests/test_jwt.py::TestJWT::test_nbf_datetime tests/test_jwt.py::TestJWT::test_nbf_with_leeway tests/test_jwt.py::TestJWT::test_nbf_in_future tests/test_jwt.py::TestJWT::test_nbf_skip tests/test_jwt.py::TestJWT::test_exp_not_int tests/test_jwt.py::TestJWT::test_exp_datetime tests/test_jwt.py::TestJWT::test_exp_with_leeway tests/test_jwt.py::TestJWT::test_exp_in_past tests/test_jwt.py::TestJWT::test_exp_skip tests/test_jwt.py::TestJWT::test_aud_string tests/test_jwt.py::TestJWT::test_aud_list tests/test_jwt.py::TestJWT::test_aud_list_multiple tests/test_jwt.py::TestJWT::test_aud_list_is_strings tests/test_jwt.py::TestJWT::test_aud_case_sensitive tests/test_jwt.py::TestJWT::test_aud_empty_claim tests/test_jwt.py::TestJWT::test_aud_not_string_or_list tests/test_jwt.py::TestJWT::test_aud_given_number tests/test_jwt.py::TestJWT::test_iss_string tests/test_jwt.py::TestJWT::test_iss_list tests/test_jwt.py::TestJWT::test_iss_tuple tests/test_jwt.py::TestJWT::test_iss_invalid tests/test_jwt.py::TestJWT::test_sub_string tests/test_jwt.py::TestJWT::test_sub_invalid tests/test_jwt.py::TestJWT::test_sub_correct tests/test_jwt.py::TestJWT::test_sub_incorrect tests/test_jwt.py::TestJWT::test_jti_string tests/test_jwt.py::TestJWT::test_jti_invalid tests/test_jwt.py::TestJWT::test_at_hash tests/test_jwt.py::TestJWT::test_at_hash_invalid tests/test_jwt.py::TestJWT::test_at_hash_missing_access_token tests/test_jwt.py::TestJWT::test_at_hash_missing_claim tests/test_jwt.py::TestJWT::test_at_hash_unable_to_calculate tests/test_jwt.py::TestJWT::test_bad_claims tests/test_jwt.py::TestJWT::test_unverified_claims_string tests/test_jwt.py::TestJWT::test_unverified_claims_list tests/test_jwt.py::TestJWT::test_unverified_claims_object tests/test_jwt.py::TestJWT::test_require[aud-aud] tests/test_jwt.py::TestJWT::test_require[ait-ait] tests/test_jwt.py::TestJWT::test_require[exp-value2] tests/test_jwt.py::TestJWT::test_require[nbf-value3] tests/test_jwt.py::TestJWT::test_require[iss-iss] tests/test_jwt.py::TestJWT::test_require[sub-sub] tests/test_jwt.py::TestJWT::test_require[jti-jti]
jose/jws.py
jose/jws.py