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]