Skip to content

Commit

Permalink
no need to force twice, now that it's been added to the base client
Browse files Browse the repository at this point in the history
  • Loading branch information
Yee Hing Tong committed Dec 6, 2019
1 parent feb403e commit fc56ce6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
9 changes: 5 additions & 4 deletions flytekit/clis/sdk_in_container/basic_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""
Expand All @@ -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))
Expand Down
3 changes: 0 additions & 3 deletions flytekit/engines/flyte/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fc56ce6

Please sign in to comment.