diff --git a/atdb/atdb/settings/base.py b/atdb/atdb/settings/base.py index aa823d9d806703b462b1d57ef9e6c60da19225fa..8f5b10b7b32f8f18f2ba66c3088345b0303dfb01 100644 --- a/atdb/atdb/settings/base.py +++ b/atdb/atdb/settings/base.py @@ -1,5 +1,7 @@ import os +import logging +logger = logging.getLogger(__name__) # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) @@ -225,7 +227,7 @@ AUTHENTICATION_BACKENDS = [ try: KEYCLOAK_URL = os.environ['KEYCLOAK_URL'] except: - KEYCLOAK_URL = 'https://sdc-dev.astron.nl/auth' + KEYCLOAK_URL = 'https://keycloak.astron.nl/auth' SOCIALACCOUNT_PROVIDERS = { 'keycloak': { @@ -238,7 +240,11 @@ SOCIALACCOUNT_PROVIDERS = { try: LOGIN_REDIRECT_URL = os.environ['LOGIN_REDIRECT_URL'] except: - LOGIN_REDIRECT_URL = 'https://sdc-dev.astron.nl:5554/atdb/' + LOGIN_REDIRECT_URL = 'https://sdc.astron.nl:5554/atdb/' + +logger.info("LOGIN_REDIRECT_URL:" + LOGIN_REDIRECT_URL) +logger.info("KEYCLOAK_URL:" + KEYCLOAK_URL) + SESSION_COOKIE_NAME = 'my_service_name_session_id' CSRF_COOKIE_NAME = 'my_service_csrftoken' diff --git a/atdb/atdb/settings/dev.py b/atdb/atdb/settings/dev.py index a3f0a997122e5a662bf9200925ef918eb8c61f46..58b33911e885963e72c5478ba2eac0ca910567c3 100644 --- a/atdb/atdb/settings/dev.py +++ b/atdb/atdb/settings/dev.py @@ -25,3 +25,10 @@ DATABASES = { AUTH_PASSWORD_VALIDATORS = [] LOGIN_REDIRECT_URL = "http://localhost:8000/atdb" +SOCIALACCOUNT_PROVIDERS = { + 'keycloak': { + 'KEYCLOAK_URL': 'https://sdc-dev.astron.nl/auth', + 'KEYCLOAK_REALM': 'SDC', + 'SCOPE': ['openid', 'profile', 'email'] + } +} \ No newline at end of file diff --git a/atdb/atdb/settings/docker_sdc.py b/atdb/atdb/settings/docker_sdc.py index 06183bc5b899a9557252679885c7ba16a8c7ee92..b77b63ace0f710978de189dd642ef4e3812d4764 100644 --- a/atdb/atdb/settings/docker_sdc.py +++ b/atdb/atdb/settings/docker_sdc.py @@ -36,11 +36,3 @@ DATABASES = { # https://docs.djangoproject.com/en/1.10/ref/settings/#auth-password-validators AUTH_PASSWORD_VALIDATORS = [] - -SOCIALACCOUNT_PROVIDERS = { - 'keycloak': { - 'KEYCLOAK_URL': 'https://keycloak.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'] - } -} diff --git a/atdb/taskdatabase/services/signals.py b/atdb/taskdatabase/services/signals.py index aab7e3ffbebd8f90250a17dcac576b2a35009a06..99c213ba04d6b4e0f67780d6b4094da86dd99f9b 100644 --- a/atdb/taskdatabase/services/signals.py +++ b/atdb/taskdatabase/services/signals.py @@ -18,7 +18,7 @@ logger = logging.getLogger(__name__) @receiver(pre_save, sender=Task) def pre_save_task_handler(sender, **kwargs): - logger.info("SIGNAL : pre_save Task(" + str(kwargs.get('instance')) + ")") + #logger.info("SIGNAL : pre_save Task(" + str(kwargs.get('instance')) + ")") handle_pre_save(sender, **kwargs) def handle_pre_save(sender, **kwargs): @@ -27,7 +27,7 @@ def handle_pre_save(sender, **kwargs): :param (in) sender: The model class that sends the trigger :param (in) kwargs: The instance of the object that sends the trigger. """ - logger.info("handle_pre_save(" + str(kwargs.get('instance')) + ")") + #logger.info("handle_pre_save(" + str(kwargs.get('instance')) + ")") myTaskObject = kwargs.get('instance') # IF this object does not exist yet, then abort, and let it first be handled by handle_post_save (get get a id).