Programatically set RSA Keys for testing purposes
tandrade96 opened this issue · 2 comments
TLDR: Is there a way to programmatically create an RSA Key? I need it to test my oidc middleware
I am testing an app that uses django-oidc-provider
, and as far as I get to understand, many operations require that an RSA key is registered (for example if I request for authorize
with a token
flow, it answers with the You must add at least one RSA Key
exception).
My problem is I don't know how to set that RSA Key creation inside my tests programmatically, I have only found about python manage.py create rsa key
but it's not what I am looking for because it is not automatic
Thank you!
Other than imports, the rsa key generation is only 3 lines.
Check out how it's accomplished in the management command here: https://github.com/juanifioren/django-oidc-provider/blob/master/oidc_provider/management/commands/creatersakey.py
Thank you so much!