get OIDC_RSA_PRIVATE_KEY from env
This commit is contained in:
parent
7aaa55eb56
commit
b8ead0d872
1 changed files with 7 additions and 2 deletions
|
|
@ -74,6 +74,12 @@ OAUTH2_PROVIDER_ACCESS_TOKEN_MODEL = 'gooyal_oauth2.AccessToken'
|
||||||
OAUTH2_PROVIDER_GRANT_MODEL = 'gooyal_oauth2.Grant'
|
OAUTH2_PROVIDER_GRANT_MODEL = 'gooyal_oauth2.Grant'
|
||||||
OAUTH2_PROVIDER_REFRESH_TOKEN_MODEL = 'gooyal_oauth2.RefreshToken'
|
OAUTH2_PROVIDER_REFRESH_TOKEN_MODEL = 'gooyal_oauth2.RefreshToken'
|
||||||
|
|
||||||
|
OIDC_RSA_PRIVATE_KEY = None
|
||||||
|
OIDC_RSA_PRIVATE_KEY_FILE_PATH = config('OIDC_RSA_PRIVATE_KEY_FILE_PATH', default=None)
|
||||||
|
if OIDC_RSA_PRIVATE_KEY_FILE_PATH:
|
||||||
|
with open(OIDC_RSA_PRIVATE_KEY_FILE_PATH) as oidc_rsa_private_key_file:
|
||||||
|
OIDC_RSA_PRIVATE_KEY = oidc_rsa_private_key_file.read()
|
||||||
|
|
||||||
OAUTH2_PROVIDER = {
|
OAUTH2_PROVIDER = {
|
||||||
# this is the list of available scopes
|
# this is the list of available scopes
|
||||||
'SCOPES_BACKEND_CLASS': 'apps.gooyal_oauth2.scopes.Scopes',
|
'SCOPES_BACKEND_CLASS': 'apps.gooyal_oauth2.scopes.Scopes',
|
||||||
|
|
@ -82,9 +88,8 @@ OAUTH2_PROVIDER = {
|
||||||
'groups': 'Access to your groups',
|
'groups': 'Access to your groups',
|
||||||
'introspection': 'Introspect token scope'},
|
'introspection': 'Introspect token scope'},
|
||||||
'OAUTH2_VALIDATOR_CLASS': 'apps.gooyal_oauth2.validators.OAuth2Validator',
|
'OAUTH2_VALIDATOR_CLASS': 'apps.gooyal_oauth2.validators.OAuth2Validator',
|
||||||
# "INTROSPECTION_USER_CREATE_METHOD": 'apps.users.models.create_user_in_introspection',
|
|
||||||
"OIDC_ENABLED": True,
|
"OIDC_ENABLED": True,
|
||||||
# "OIDC_RSA_PRIVATE_KEY": config("OIDC_RSA_PRIVATE_KEY"),
|
"OIDC_RSA_PRIVATE_KEY": OIDC_RSA_PRIVATE_KEY,
|
||||||
# Enable and configure RP-Initiated Logout
|
# Enable and configure RP-Initiated Logout
|
||||||
"OIDC_RP_INITIATED_LOGOUT_ENABLED": True,
|
"OIDC_RP_INITIATED_LOGOUT_ENABLED": True,
|
||||||
"OIDC_RP_INITIATED_LOGOUT_ALWAYS_PROMPT": True,
|
"OIDC_RP_INITIATED_LOGOUT_ALWAYS_PROMPT": True,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue