Take state from query param on hydra callback

This commit is contained in:
Luka Radenovic 2022-01-19 09:16:22 +01:00
parent 2160f634d1
commit 45728d1383
3 changed files with 10 additions and 8 deletions

View file

@ -24,11 +24,9 @@ class HydraOauth:
raise HydraError(str(err), 500)
@staticmethod
def get_token():
def get_token(state):
try:
hydra = OAuth2Session(
HYDRA_CLIENT_ID, state=session[HydraOauth.SESSION_KEY]
)
hydra = OAuth2Session(HYDRA_CLIENT_ID, state=state)
token = hydra.fetch_token(
TOKEN_URL,
client_secret=HYDRA_CLIENT_SECRET,