diff --git a/atdb/atdb/settings/base.py b/atdb/atdb/settings/base.py index 34afccd7d57b985c3745a4d1ef5d5abf5a7c664e..aa823d9d806703b462b1d57ef9e6c60da19225fa 100644 --- a/atdb/atdb/settings/base.py +++ b/atdb/atdb/settings/base.py @@ -222,10 +222,15 @@ AUTHENTICATION_BACKENDS = [ "allauth.account.auth_backends.AuthenticationBackend", ] +try: + KEYCLOAK_URL = os.environ['KEYCLOAK_URL'] +except: + KEYCLOAK_URL = 'https://sdc-dev.astron.nl/auth' + SOCIALACCOUNT_PROVIDERS = { 'keycloak': { - 'KEYCLOAK_URL': 'https://sdc-dev.astron.nl/auth', # replace by https://keycloak.astron.nl/auth for production - 'KEYCLOAK_REALM': 'SDC', # change this depending on which realm to use + 'KEYCLOAK_URL': KEYCLOAK_URL, + 'KEYCLOAK_REALM': 'SDC', 'SCOPE': ['openid', 'profile', 'email'] } } diff --git a/atdb/atdb/settings/dev.py b/atdb/atdb/settings/dev.py index 8c9925a1c09fb042fa2979d79353f4c43a2247ad..a3f0a997122e5a662bf9200925ef918eb8c61f46 100644 --- a/atdb/atdb/settings/dev.py +++ b/atdb/atdb/settings/dev.py @@ -24,13 +24,4 @@ DATABASES = { AUTH_PASSWORD_VALIDATORS = [] -# astronauth settings -SOCIALACCOUNT_PROVIDERS = { - 'keycloak': { - 'KEYCLOAK_URL': 'https://sdc-dev.astron.nl/auth', # replace by https://keycloak.astron.nl/auth for production - 'KEYCLOAK_REALM': 'SDC', # change this depending on which realm to use - 'SCOPE': ['openid', 'profile', 'email'] - } -} - LOGIN_REDIRECT_URL = "http://localhost:8000/atdb"