Skip to content

Commit 6078323

Browse files
authored
refactor: update issuer usage (#17)
1 parent b927138 commit 6078323

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

samples/server/whoami.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ def verify_access_token(token: str) -> AuthInfo:
5454
If the token is valid, it returns an `AuthInfo` object containing the user's information.
5555
"""
5656

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

0 commit comments

Comments
 (0)