fix: update auth_callback to include client_id in request body for OIDC providers
This commit is contained in:
+1
-3
@@ -78,15 +78,13 @@ async def auth_callback(payload: AuthCallbackRequest):
|
||||
"code": payload.code,
|
||||
"code_verifier": payload.code_verifier,
|
||||
"redirect_uri": str(payload.redirect_uri),
|
||||
"client_id": settings.oidc_client_id,
|
||||
}
|
||||
|
||||
# Some OIDC providers expect client credentials via HTTP Basic auth
|
||||
auth = None
|
||||
if settings.oidc_client_secret:
|
||||
auth = (settings.oidc_client_id, settings.oidc_client_secret)
|
||||
else:
|
||||
# public client: include client_id in the request body
|
||||
data["client_id"] = settings.oidc_client_id
|
||||
|
||||
async with httpx.AsyncClient(timeout=15.0) as client:
|
||||
response = await client.post(token_endpoint, data=data, headers={"Accept": "application/json"}, auth=auth)
|
||||
|
||||
Reference in New Issue
Block a user