Update get_token function
This commit is contained in:
parent
34796a7d82
commit
f0d83c6886
1 changed files with 6 additions and 5 deletions
|
@ -26,12 +26,13 @@ class HydraOauth:
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_token(state, code):
|
def get_token(state, code):
|
||||||
try:
|
try:
|
||||||
hydra = OAuth2Session(HYDRA_CLIENT_ID, state=state)
|
hydra = OAuth2Session(
|
||||||
token = hydra.fetch_token(
|
HYDRA_CLIENT_ID,
|
||||||
TOKEN_URL,
|
|
||||||
code=code,
|
|
||||||
state=state,
|
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
|
session["hydra_token"] = token
|
||||||
|
|
Loading…
Reference in a new issue