Store raw access token within user; get resource
This commit is contained in:
parent
e1dac77738
commit
dc181bd3a8
7 changed files with 94 additions and 30 deletions
|
@ -200,7 +200,7 @@ async def auth(request: Request, oidc_provider_id: str) -> RedirectResponse:
|
|||
user_info=userinfo,
|
||||
oidc_provider=oidc_provider,
|
||||
user_info_from_endpoint=user_info_from_endpoint,
|
||||
access_token=access_token,
|
||||
access_token=token["access_token"],
|
||||
)
|
||||
# Add the id_token to the session
|
||||
request.session["token"] = token["id_token"]
|
||||
|
@ -229,7 +229,7 @@ async def account(
|
|||
raise HTTPException(
|
||||
status.HTTP_406_NOT_ACCEPTABLE, detail="No oidc provider settings"
|
||||
)
|
||||
return RedirectResponse(f"{oidc_provider_settings.account_url}")
|
||||
return RedirectResponse(f"{oidc_provider_settings.account_url_template}")
|
||||
|
||||
|
||||
@app.get("/logout")
|
||||
|
@ -243,7 +243,9 @@ async def logout(
|
|||
if (
|
||||
provider_logout_uri := oidc_provider.server_metadata.get("end_session_endpoint")
|
||||
) is None:
|
||||
logger.warn(f"Cannot find end_session_endpoint for provider {provider.name}")
|
||||
logger.warn(
|
||||
f"Cannot find end_session_endpoint for provider {oidc_provider.name}"
|
||||
)
|
||||
return RedirectResponse(request.url_for("non_compliant_logout"))
|
||||
post_logout_uri = request.url_for("home")
|
||||
if (token := await db.get_token(request.session.pop("token", None))) is None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue