From d23e5ca30dda39a0815c16ac744ff9f14b99ba34 Mon Sep 17 00:00:00 2001 From: Benoit Suttor Date: Mon, 4 Oct 2021 17:09:19 +0200 Subject: [PATCH] feat: add authorization_flow to import script --- .../management/commands/wc-base-import.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/authentic2_wallonie_connect/management/commands/wc-base-import.py b/src/authentic2_wallonie_connect/management/commands/wc-base-import.py index 2d0aaa8..3c3c8cd 100644 --- a/src/authentic2_wallonie_connect/management/commands/wc-base-import.py +++ b/src/authentic2_wallonie_connect/management/commands/wc-base-import.py @@ -139,13 +139,17 @@ class Command(BaseCommand): "identifier_policy", OIDCClient.POLICY_UUID ) assert isinstance(identifier_policy, int) + authorization_flow = service.get( + "authorization_flow", OIDCClient.FLOW_AUTHORIZATION_CODE + ) + assert isinstance(authorization_flow, int) + idtoken_algo = OIDCClient.ALGO_HMAC if "idtoken_algo" in service: idtoken_algo = getattr( OIDCClient, "ALGO_" + service["idtoken_algo"].upper() ) scope = service.get("scope", "") - oidc_client, created = OIDCClient.objects.get_or_create( slug=service["slug"], ou=ou, @@ -160,6 +164,7 @@ class Command(BaseCommand): "redirect_uris": "\n".join(redirect_uris), "has_api_access": has_api_access, "identifier_policy": identifier_policy, + "authorization_flow": authorization_flow, "idtoken_algo": idtoken_algo, "scope": scope, }, @@ -177,6 +182,7 @@ class Command(BaseCommand): "has_api_access", "idtoken_algo", "identifier_policy", + "authorization_flow", "scope", ): value = locals()[key]