From f0d83c6886608ab97cbc81b84b2a9f78cdd54ebb Mon Sep 17 00:00:00 2001 From: Luka Radenovic Date: Thu, 20 Jan 2022 07:49:11 +0100 Subject: [PATCH] Update get_token function --- helpers/hydra_oauth.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/helpers/hydra_oauth.py b/helpers/hydra_oauth.py index e29e10a..de11c88 100644 --- a/helpers/hydra_oauth.py +++ b/helpers/hydra_oauth.py @@ -26,12 +26,13 @@ class HydraOauth: @staticmethod def get_token(state, code): try: - hydra = OAuth2Session(HYDRA_CLIENT_ID, state=state) - token = hydra.fetch_token( - TOKEN_URL, - code=code, + hydra = OAuth2Session( + HYDRA_CLIENT_ID, state=state, - client_secret=HYDRA_CLIENT_SECRET, + token_endpoint_auth_method="client_secret_basic", + ) + token = hydra.fetch_token( + TOKEN_URL, code=code, state=state, client_secret=HYDRA_CLIENT_SECRET ) session["hydra_token"] = token