File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 11from typing import Any , Dict
22import httpx
33import jwt
4- from fastapi import Depends , HTTPException , WebSocket , status
4+ from fastapi import Depends , WebSocket , status
55from fastapi .security import OAuth2AuthorizationCodeBearer
66from jwt import PyJWKClient
77from loguru import logger
@@ -96,15 +96,15 @@ async def exchange_token_for_provider(
9696
9797 :return: The token response (dict) on success.
9898
99- :raise: Raises HTTPException with an appropriate status and message on error.
99+ :raise: Raises AuthException with an appropriate status and message on error.
100100 """
101101 token_url = f"{ KEYCLOAK_BASE_URL } /protocol/openid-connect/token"
102102
103103 # Check if the necessary settings are in place
104104 if not settings .keycloak_client_id or not settings .keycloak_client_secret :
105- raise HTTPException (
106- status_code = status .HTTP_500_INTERNAL_SERVER_ERROR ,
107- detail = "Token exchange not configured on the server (missing client credentials)." ,
105+ raise AuthException (
106+ http_status = status .HTTP_500_INTERNAL_SERVER_ERROR ,
107+ message = "Token exchange not configured on the server (missing client credentials)." ,
108108 )
109109
110110 payload = {
You can’t perform that action at this time.
0 commit comments