Skip to content

fix(oidc): use a string for the default ID token aud - #1062

Open
ratomirjovanovic wants to merge 2 commits into
authlib:mainfrom
ratomirjovanovic:fix/1054-id-token-aud-string
Open

ratomirjovanovic wants to merge 2 commits into
authlib:mainfrom
ratomirjovanovic:fix/1054-id-token-aud-string

Conversation

@ratomirjovanovic

@ratomirjovanovic ratomirjovanovic commented Nov 15, 2026 •

Copy link
Copy Markdown

Closes #1054

When get_client_claims returns no aud, get_compatible_claims now sets it to the client ID as a string instead of [client_id]. I updated the get_client_claims docstring and the Flask OpenID Connect example that asserted the list.

test_default_aud_claim in test_openid_code_grant.py covers it (its get_client_claims only returns iss). The changelog fragment is under Changed, since servers that read the claim back get a string now.

Updated with current main. test_user_info_does_not_replace_protocol_claims, added there since, expected the list, so I changed that assertion to the string.

Ran uv run --all-groups pytest tests docs (2888 passed, 49 skipped) and prek run --all-files.

Without aud from get_client_claims, the ID token had [client_id]. OpenID
Connect Core section 2 allows a single string for one audience, and with
the list RP-initiated logout cannot resolve the client from an
id_token_hint sent without client_id.

Closes authlib#1054
…-string

# Conflicts:
#	tests/flask/test_oauth2/test_openid_code_grant.py

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use a string for the default ID token aud

1 participant