From fdf2c6fd80e7960dcbb99cb78b5cb551968b5ef1 Mon Sep 17 00:00:00 2001
From: Ernesto Rico Schmidt <ernesto@helsinki.at>
Date: Tue, 23 May 2023 16:28:41 -0400
Subject: [PATCH] Add Makefile targets to create OIDC clients

Closes #153
---
 Makefile | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 0e82f89d..a49db52b 100644
--- a/Makefile
+++ b/Makefile
@@ -12,12 +12,16 @@ ifndef DASHBOARD_CALLBACK_BASE_URL
 override DASHBOARD_CALLBACK_BASE_URL = "${AURA_PROTO}://${AURA_HOST}"
 endif
 
-initialize: migrate loadfixtures
+create_oidc_client.dashboard:
+	$(POETRY_RUN_MANAGE) create_oidc_client dashboard public --client-id ${DASHBOARD_OIDC_CLIENT_ID} --client-secret ${DASHBOARD_OIDC_CLIENT_SECRET} -r "id_token token" -u ${DASHBOARD_CALLBACK_BASE_URL}/oidc_callback.html -u ${DASHBOARD_CALLBACK_BASE_URL}/oidc_callback_silentRenew.html -p ${DASHBOARD_CALLBACK_BASE_URL} -p ${DASHBOARD_CALLBACK_BASE_URL}/
+
+create_oidc_client.tank:
+	$(POETRY_RUN_MANAGE) create_oidc_client tank confidential --client-id ${TANK_OIDC_CLIENT_ID} --client-secret ${TANK_OIDC_CLIENT_SECRET} -r "code" -u ${TANK_CALLBACK_BASE_URL}/tank/auth/oidc/callback
+
+initialize: migrate loadfixtures create_oidc_client.dashboard create_oidc_client.tank
 	$(POETRY_RUN_MANAGE) collectstatic --clear --no-input
 	$(POETRY_RUN_MANAGE) createsuperuser --no-input
 	$(POETRY_RUN_MANAGE) creatersakey
-	$(POETRY_RUN_MANAGE) create_oidc_client dashboard public --client-id ${DASHBOARD_OIDC_CLIENT_ID} --client-secret ${DASHBOARD_OIDC_CLIENT_SECRET} -r "id_token token" -u ${DASHBOARD_CALLBACK_BASE_URL}/oidc_callback.html -u ${DASHBOARD_CALLBACK_BASE_URL}/oidc_callback_silentRenew.html -p ${DASHBOARD_CALLBACK_BASE_URL} -p ${DASHBOARD_CALLBACK_BASE_URL}/
-	$(POETRY_RUN_MANAGE) create_oidc_client tank confidential --client-id ${TANK_OIDC_CLIENT_ID} --client-secret ${TANK_OIDC_CLIENT_SECRET} -r "code" -u ${TANK_CALLBACK_BASE_URL}/tank/auth/oidc/callback
 
 showmigrations:
 	$(POETRY_RUN_MANAGE) showmigrations
-- 
GitLab