This commit is contained in:
Timothy Jaeryang Baek
2026-03-08 17:52:49 -05:00
parent 9d8f590fc5
commit 3f350f8659
2 changed files with 23 additions and 2 deletions
+14
View File
@@ -46,6 +46,7 @@ from fastapi import APIRouter, Depends, HTTPException, Request, status
from fastapi.responses import RedirectResponse, Response, JSONResponse
from open_webui.config import (
OPENID_PROVIDER_URL,
OPENID_END_SESSION_ENDPOINT,
ENABLE_OAUTH_SIGNUP,
ENABLE_LDAP,
ENABLE_PASSWORD_AUTH,
@@ -824,6 +825,19 @@ async def signout(
response.delete_cookie("oauth_session_id")
session = OAuthSessions.get_session_by_id(oauth_session_id, db=db)
# If a custom end_session_endpoint is configured (e.g. AWS Cognito), redirect
# there directly instead of attempting OIDC discovery.
if OPENID_END_SESSION_ENDPOINT.value:
return JSONResponse(
status_code=200,
content={
"status": True,
"redirect_url": OPENID_END_SESSION_ENDPOINT.value,
},
headers=response.headers,
)
oauth_server_metadata_url = (
request.app.state.oauth_manager.get_server_metadata_url(session.provider)
if session