From 4afdc13b0362a5aa103fd3c99be2e2246db38cd8 Mon Sep 17 00:00:00 2001 From: Hossein Shafagh Date: Fri, 15 Jan 2021 16:44:05 -0800 Subject: [PATCH] adding config to use the default clientID --- lemur/plugins/lemur_entrust/plugin.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lemur/plugins/lemur_entrust/plugin.py b/lemur/plugins/lemur_entrust/plugin.py index 903bd7a9..bc7a8689 100644 --- a/lemur/plugins/lemur_entrust/plugin.py +++ b/lemur/plugins/lemur_entrust/plugin.py @@ -80,7 +80,6 @@ def process_options(options, client_id): "eku": "SERVER_AND_CLIENT_AUTH", "certType": product_type, "certExpiryDate": validity_end, - # "keyType": "RSA", Entrust complaining about this parameter "tracking": tracking_data, "org": options.get("organization"), "clientId": client_id @@ -229,7 +228,11 @@ class EntrustIssuerPlugin(IssuerPlugin): except requests.exceptions.RequestException as e: raise Exception(f"Error for Getting Organization {e}") - client_id = get_client_id(response, issuer_options.get("organization")) + if current_app.config.get("ENTRUST_USE_DEFAULT_CLIENT_ID"): + # The ID of the primary client is 1. + client_id = 1 + else: + client_id = get_client_id(response, issuer_options.get("organization")) log_data = { "function": f"{__name__}.{sys._getframe().f_code.co_name}", "message": f"Organization id: {client_id}"