diff --git a/oidc_provider/lib/utils/common.py b/oidc_provider/lib/utils/common.py index 3905231..c3565ec 100644 --- a/oidc_provider/lib/utils/common.py +++ b/oidc_provider/lib/utils/common.py @@ -22,7 +22,10 @@ def get_rsa_key(): Load the rsa key previously created with `creatersakey` command. """ file_path = settings.get('OIDC_RSA_KEY_FOLDER') + '/OIDC_RSA_KEY.pem' - with open(file_path, 'r') as f: - key = f.read() + try: + with open(file_path, 'r') as f: + key = f.read() + except IOError: + raise IOError('We could not find your key file on: ' + file_path) return key