Create get_rsa_key function to obtain the key from filesystem.
This commit is contained in:
parent
5ba5b1581d
commit
f7e8fa460c
1 changed files with 21 additions and 9 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
from django.conf import settings as django_settings
|
||||||
from django.core.urlresolvers import reverse
|
from django.core.urlresolvers import reverse
|
||||||
|
|
||||||
from oidc_provider import settings
|
from oidc_provider import settings
|
||||||
|
@ -14,3 +15,14 @@ def get_issuer():
|
||||||
issuer = site_url + path
|
issuer = site_url + path
|
||||||
|
|
||||||
return issuer
|
return issuer
|
||||||
|
|
||||||
|
|
||||||
|
def get_rsa_key():
|
||||||
|
"""
|
||||||
|
Load the rsa key previously created with `creatersakey` command.
|
||||||
|
"""
|
||||||
|
file_path = django_settings.BASE_DIR + '/OIDC_RSA_KEY.pem'
|
||||||
|
with open(file_path, 'r') as f:
|
||||||
|
key = f.read()
|
||||||
|
|
||||||
|
return key
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue