refac
This commit is contained in:
1 parent
c416c6cad6
commit
9562f036f8
1 file changed
+10
@@ -24,6 +24,8 @@ from fastapi import (
|
|||||||
HTTPException,
|
HTTPException,
|
||||||
status,
|
status,
|
||||||
)
|
)
|
||||||
|
from joserfc.jws import JWSRegistry
|
||||||
|
from joserfc.registry import HeaderParameter
|
||||||
from mcp.shared.auth import (
|
from mcp.shared.auth import (
|
||||||
OAuthClientMetadata as MCPOAuthClientMetadata,
|
OAuthClientMetadata as MCPOAuthClientMetadata,
|
||||||
)
|
)
|
||||||
@@ -187,6 +189,14 @@ async def get_oauth_runtime_config() -> SimpleNamespace:
|
|||||||
DEFAULT_TOKEN_EXPIRY_SECONDS = 3600
|
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:
|
def _normalize_token_expiry(token: dict) -> dict:
|
||||||
"""Ensure a token dict always has a numeric ``expires_at``.
|
"""Ensure a token dict always has a numeric ``expires_at``.
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user