Skip to content
Snippets Groups Projects
Commit f9c896a6 authored by Nico Vermaas's avatar Nico Vermaas
Browse files

Merge branch 'master' into 'SDC-1005-multiple-summary-structures'

merge keycloak changes into branch

See merge request !323
parents bc0ce88c aec43761
Branches
No related tags found
2 merge requests!324Merge branch 'master' into 'SDC-1005-multiple-summary-structures',!323merge keycloak changes into branch
Pipeline #59869 passed
......@@ -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
......@@ -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
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
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
......@@ -31,7 +31,7 @@
{% include 'taskdatabase/pagination.html' %}
</div>
</div>
<p class="footer"> Version 31 Aug 2023
<p class="footer"> Version 3 Oct 2023
</div>
{% include 'taskdatabase/refresh.html' %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment