Skip to content
This repository has been archived by the owner on Mar 13, 2022. It is now read-only.

Commit

Permalink
Improve similarity with kubelet in handling of oidc kubeconfigs
Browse files Browse the repository at this point in the history
- allow 'client-secret' to be empty
  • Loading branch information
Vladimir Jigulin committed Sep 26, 2019
1 parent 95858d5 commit 8f41346
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions config/kube_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,13 +361,14 @@ def _refresh_oidc(self, provider):
return

response = json.loads(response.data)
client_secret = provider['config'].safe_get('client-secret') or ''

request = OAuth2Session(
client_id=provider['config']['client-id'],
token=provider['config']['refresh-token'],
auto_refresh_kwargs={
'client_id': provider['config']['client-id'],
'client_secret': provider['config']['client-secret']
'client_secret': client_secret
},
auto_refresh_url=response['token_endpoint']
)
Expand All @@ -377,7 +378,7 @@ def _refresh_oidc(self, provider):
token_url=response['token_endpoint'],
refresh_token=provider['config']['refresh-token'],
auth=(provider['config']['client-id'],
provider['config']['client-secret']),
client_secret),
verify=config.ssl_ca_cert if config.verify_ssl else None
)
except oauthlib.oauth2.rfc6749.errors.InvalidClientIdError:
Expand Down

0 comments on commit 8f41346

Please sign in to comment.