diff --git a/src/openforms/authentication/tasks.py b/src/openforms/authentication/tasks.py index 7f6182cc35..4c217db68a 100644 --- a/src/openforms/authentication/tasks.py +++ b/src/openforms/authentication/tasks.py @@ -1,3 +1,5 @@ +from django.core.management import call_command + from openforms.celery import app @@ -7,3 +9,16 @@ def hash_identifying_attributes(auth_info_id: int): auth_info = AuthInfo.objects.get(id=auth_info_id) auth_info.hash_identifying_attributes() + + +@app.task +def update_saml_metadata() -> None: + """ + A weekly task for updating the SAML metadata concerning DigiD/Eherkenning + + Calling the command update_stored_metadata which is part of the + `digid_eherkenning.management.commands` module of django-digid-eherkenning library. + Updates the stored metadata file and prepopulates the db fields. + """ + call_command("update_stored_metadata", "digid") + call_command("update_stored_metadata", "eherkenning") diff --git a/src/openforms/conf/base.py b/src/openforms/conf/base.py index e6411494aa..3f55c27be5 100644 --- a/src/openforms/conf/base.py +++ b/src/openforms/conf/base.py @@ -775,6 +775,10 @@ "task": "django_yubin.tasks.delete_old_emails", "schedule": crontab(hour=0, minute=0, day_of_week="*"), }, + "update-saml-digid-eherkenning": { + "task": "openforms.authentication.tasks.update_saml_metadata", + "schedule": crontab(hour=0, minute=0, day_of_week="sunday"), + }, } RETRY_SUBMISSIONS_TIME_LIMIT = config(