From fc56ce6405abc051aa52044bada67eb20a4f632f Mon Sep 17 00:00:00 2001 From: Yee Hing Tong Date: Fri, 6 Dec 2019 09:10:47 -0800 Subject: [PATCH] no need to force twice, now that it's been added to the base client --- flytekit/clis/sdk_in_container/basic_auth.py | 9 +++++---- flytekit/engines/flyte/engine.py | 3 --- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/flytekit/clis/sdk_in_container/basic_auth.py b/flytekit/clis/sdk_in_container/basic_auth.py index f3211b97d5..05671752e0 100644 --- a/flytekit/clis/sdk_in_container/basic_auth.py +++ b/flytekit/clis/sdk_in_container/basic_auth.py @@ -39,9 +39,9 @@ def get_basic_authorization_header(client_id, client_secret): def get_token(token_endpoint, authorization_header, scope): """ - :param token_endpoint: - :param authorization_header: - :param scope: + :param Text token_endpoint: + :param Text authorization_header: This is the value for the "Authorization" key. (eg 'Bearer abc123') + :param Text scope: :rtype: (Text,Int) The first element is the access token retrieved from the IDP, the second is the expiration in seconds """ @@ -53,8 +53,9 @@ def get_token(token_endpoint, authorization_header, scope): } body = { 'grant_type': 'client_credentials', - 'scope': scope, } + if scope is not None: + body['scope'] = scope response = _requests.post(token_endpoint, data=body, headers=headers) if response.status_code != 200: _logging.error("Non-200 ({}) received from IDP: {}".format(response.status_code, response.text)) diff --git a/flytekit/engines/flyte/engine.py b/flytekit/engines/flyte/engine.py index a326274b6a..bfe76bf24a 100644 --- a/flytekit/engines/flyte/engine.py +++ b/flytekit/engines/flyte/engine.py @@ -33,9 +33,6 @@ def __init__(self, *args, **kwargs): # TODO: use cases. if type(self)._CLIENT is None: c = _SynchronousFlyteClient(*args, **kwargs) - if _platform_config.AUTH.get(): - # Force authentication - c.force_auth_flow() type(self)._CLIENT = c @property