diff --git a/atdb/atdb/settings/base.py b/atdb/atdb/settings/base.py
index 376c991aa2c4ec17f799f2d7b6823db02b1f4a3a..7fcfe6e7378954c1a98fd8197f803f1e16dd93d2 100644
--- a/atdb/atdb/settings/base.py
+++ b/atdb/atdb/settings/base.py
@@ -45,8 +45,7 @@ INSTALLED_APPS = [
     'allauth',
     'allauth.account',
     'allauth.socialaccount',
-    'allauth.socialaccount.providers.keycloak',
-
+    'allauth.socialaccount.providers.openid_connect',
 ]
 
 MIDDLEWARE = [
@@ -59,6 +58,7 @@ MIDDLEWARE = [
     'django.contrib.auth.middleware.AuthenticationMiddleware',
     'django.contrib.messages.middleware.MessageMiddleware',
     'django.middleware.clickjacking.XFrameOptionsMiddleware',
+    'allauth.account.middleware.AccountMiddleware',
     #'silk.middleware.SilkyMiddleware',
 ]
 
@@ -228,17 +228,27 @@ AUTHENTICATION_BACKENDS = [
     "allauth.account.auth_backends.AuthenticationBackend",
 ]
 
-try:
-    KEYCLOAK_URL = os.environ['KEYCLOAK_URL']
-except:
-    KEYCLOAK_URL = 'https://keycloak.astron.nl/auth'
-
+# Set your keycloak url and realm
 SOCIALACCOUNT_PROVIDERS = {
-    'keycloak': {
-        'KEYCLOAK_URL': KEYCLOAK_URL,
-        'KEYCLOAK_REALM': 'SDC',
-        'SCOPE': ['openid', 'profile', 'email']
-    }
+    "openid_connect": {
+        "SERVERS": [
+            {
+                "id": "keycloak",
+                "name": "Keycloak",
+                "server_url": os.getenv(
+                    "KEYCLOAK_URL", "https://keycloak.astron.nl/auth"
+                )
+                + "/realms/"
+                + os.getenv("KEYCLOAK_REALM", "SDC")
+                + "/.well-known/openid-configuration",
+                "APP": {
+                    "client_id": os.getenv("KEYCLOAK_CLIENT_ID"),
+                    "secret": os.getenv("KEYCLOAK_CLIENT_SECRET"),
+                },
+                "SCOPE": ["openid", "profile", "email"],
+            }
+        ]
+    },
 }
 
 try:
@@ -247,11 +257,10 @@ except:
     LOGIN_REDIRECT_URL = '/atdb/'
 
 logger.info("LOGIN_REDIRECT_URL:" + LOGIN_REDIRECT_URL)
-logger.info("KEYCLOAK_URL:" + KEYCLOAK_URL)
 
 
 SESSION_COOKIE_NAME = 'atdb_session_id'
 CSRF_COOKIE_NAME = 'atdb_csrftoken'
 
 #SILKY_PYTHON_PROFILER = False
-#SILKY_PYTHON_PROFILER_BINARY = False
\ No newline at end of file
+#SILKY_PYTHON_PROFILER_BINARY = False
diff --git a/atdb/atdb/settings/dev.py b/atdb/atdb/settings/dev.py
index 21e8c6752734c14e8f322cafcf8bffa85fefabda..9fa96624367f8d1868eba5a207c6c3b757a0cd20 100644
--- a/atdb/atdb/settings/dev.py
+++ b/atdb/atdb/settings/dev.py
@@ -13,9 +13,7 @@ DATABASES = {
          'ENGINE': 'django.db.backends.postgresql_psycopg2',
          'USER': 'atdb_admin',
          'PASSWORD': 'atdb123',
-         #'NAME': 'atdb_ldv_astronauth_6feb2023',
-          #'NAME': 'atdb_ldv_27jun2023',
-        'NAME': 'atdb_ldv_8aug2023',
+         'NAME': 'atdb_ldv_8aug2023',
          'HOST': 'localhost',
          'PORT': '5432',
     },
@@ -27,10 +25,3 @@ 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/requirements/base.txt b/atdb/requirements/base.txt
index 694d6390891498915492476fedd248119e11fd94..bf22f77447b2baa8b3f4921b1242da4cf04d9968 100644
--- a/atdb/requirements/base.txt
+++ b/atdb/requirements/base.txt
@@ -1,6 +1,6 @@
 astronauth==0.3.3
 Django==3.2
-django-allauth==0.52.0
+django-allauth==0.57.0  # note allauth only supports Django >= 3.2
 django-bootstrap-pagination==1.7.0
 django-bootstrap3==14.2.0
 django-cors-headers==3.6.0
@@ -15,4 +15,4 @@ psycopg2-binary==2.9.3
 python3-openid==3.2.0
 requests-oauthlib==1.3.1
 six==1.15.0
-whitenoise==5.0.1
\ No newline at end of file
+whitenoise==5.0.1
diff --git a/atdb/run.bat b/atdb/run.bat
deleted file mode 100644
index b428ce925c06e0abed59a1a7ff7396c680dae321..0000000000000000000000000000000000000000
--- a/atdb/run.bat
+++ /dev/null
@@ -1,7 +0,0 @@
-SET DEBUG=True
-SET DATABASE_HOST=localhost
-SET DATABASE_PORT=5432
-SET DATABASE_NAME=atdb_ldv
-SET DATABASE_USER=atdb_admin
-SET DATABASE_PASSWORD=atdb123
-python manage.py runserver --settings=atdb.settings.dev