mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-09 16:09:10 +00:00
refac
This commit is contained in:
parent
c416c6cad6
commit
9562f036f8
1 changed files with 10 additions and 0 deletions
|
|
@ -24,6 +24,8 @@ from fastapi import (
|
|||
HTTPException,
|
||||
status,
|
||||
)
|
||||
from joserfc.jws import JWSRegistry
|
||||
from joserfc.registry import HeaderParameter
|
||||
from mcp.shared.auth import (
|
||||
OAuthClientMetadata as MCPOAuthClientMetadata,
|
||||
)
|
||||
|
|
@ -187,6 +189,14 @@ async def get_oauth_runtime_config() -> SimpleNamespace:
|
|||
DEFAULT_TOKEN_EXPIRY_SECONDS = 3600
|
||||
|
||||
|
||||
# Apereo CAS includes client_id in ID token JWS headers; Authlib 1.7/joserfc
|
||||
# rejects unknown headers unless we register the provider extension.
|
||||
JWSRegistry.default_header_registry.setdefault(
|
||||
'client_id',
|
||||
HeaderParameter('OAuth client identifier', 'str'),
|
||||
)
|
||||
|
||||
|
||||
def _normalize_token_expiry(token: dict) -> dict:
|
||||
"""Ensure a token dict always has a numeric ``expires_at``.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue