juanifioren/django-oidc-provider

Upgrading to Django2.2 has broken my tests

mattjegan opened this issue · 1 comments

I have tests that make calls to /openid/token that were passing when I was using django<2. I'm reasonably sure that the issue is in this library as I haven't changed any of the parameters passed in the request. This is the stack trace, is there any quick fix that you know of? I'm using version 0.7.0 of django-oidc-provider.

ERROR:django.request:Internal Server Error: /openid/token
Traceback (most recent call last):
  File "/Users/eganm/.local/share/virtualenvs/divipay-api-xqRGoeqW/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
    response = get_response(request)
  File "/Users/eganm/.local/share/virtualenvs/divipay-api-xqRGoeqW/lib/python3.6/site-packages/django/core/handlers/base.py", line 115, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/Users/eganm/.local/share/virtualenvs/divipay-api-xqRGoeqW/lib/python3.6/site-packages/django/core/handlers/base.py", line 113, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/Users/eganm/.local/share/virtualenvs/divipay-api-xqRGoeqW/lib/python3.6/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
    return view_func(*args, **kwargs)
  File "/Users/eganm/.local/share/virtualenvs/divipay-api-xqRGoeqW/lib/python3.6/site-packages/django/views/generic/base.py", line 71, in view
    return self.dispatch(request, *args, **kwargs)
  File "/Users/eganm/.local/share/virtualenvs/divipay-api-xqRGoeqW/lib/python3.6/site-packages/django/views/generic/base.py", line 97, in dispatch
    return handler(request, *args, **kwargs)
  File "/Users/eganm/.local/share/virtualenvs/divipay-api-xqRGoeqW/lib/python3.6/site-packages/oidc_provider/views.py", line 212, in post
    dic = token.create_response_dic()
  File "/Users/eganm/.local/share/virtualenvs/divipay-api-xqRGoeqW/lib/python3.6/site-packages/oidc_provider/lib/endpoints/token.py", line 144, in create_response_dic
    return self.create_access_token_response_dic()
  File "/Users/eganm/.local/share/virtualenvs/divipay-api-xqRGoeqW/lib/python3.6/site-packages/oidc_provider/lib/endpoints/token.py", line 257, in create_access_token_response_dic
    'id_token': encode_id_token(id_token_dic, token.client),
  File "/Users/eganm/.local/share/virtualenvs/divipay-api-xqRGoeqW/lib/python3.6/site-packages/oidc_provider/lib/utils/token.py", line 76, in encode_id_token
    keys = get_client_alg_keys(client)
  File "/Users/eganm/.local/share/virtualenvs/divipay-api-xqRGoeqW/lib/python3.6/site-packages/oidc_provider/lib/utils/token.py", line 158, in get_client_alg_keys
    keys.append(jwk_RSAKey(key=importKey(rsakey.key), kid=rsakey.kid))
  File "/Users/eganm/.local/share/virtualenvs/divipay-api-xqRGoeqW/lib/python3.6/site-packages/Cryptodome/PublicKey/RSA.py", line 754, in import_key
    raise ValueError("RSA key format is not supported")
ValueError: RSA key format is not supported

We no longer support this versions.