Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion samples/server/whoami.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def verify_access_token(token: str) -> AuthInfo:
If the token is valid, it returns an `AuthInfo` object containing the user's information.
"""

issuer = auth_server_config.metadata.issuer
endpoint = auth_server_config.metadata.userinfo_endpoint
if not endpoint:
raise ValueError(
Expand All @@ -74,7 +75,7 @@ def verify_access_token(token: str) -> AuthInfo:
subject=json.get(
"sub"
), # 'sub' is a standard claim for the subject (user's ID)
issuer=auth_issuer, # Use the configured issuer
issuer=issuer, # Use the issuer from the metadata
claims=json, # Include all claims (JSON fields) returned by the userinfo endpoint
)
# `AuthInfo` is a Pydantic model, so validation errors usually mean the response didn't match
Expand Down