Skip to content
This repository has been archived by the owner on Oct 3, 2020. It is now read-only.

Commit

Permalink
Use ID token if auth type is OIDC
Browse files Browse the repository at this point in the history
Simply use the ID token inside the Authentication header for the OIDC
case. This helps at least a bit when running locally as long as the ID
token is still valid.
  • Loading branch information
twz123 committed Sep 4, 2019
1 parent 46f2738 commit 1f6a28e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pykube/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,11 @@ def send(self, request, **kwargs):
auth_config.get("expiry"),
config,
)
# @@@ support oidc
elif auth_provider.get("name") == "oidc":
auth_config = auth_provider.get("config", {})
# @@@ support token refresh
if "id-token" in auth_config:
request.headers["Authorization"] = "Bearer {}".format(auth_config["id-token"])
elif "client-certificate" in config.user:
kwargs["cert"] = (
config.user["client-certificate"].filename(),
Expand Down

0 comments on commit 1f6a28e

Please sign in to comment.