Browse Source
OpenID Connect Core 5.3.2 requires that the sub claim of the userinfo response is verified to exactly match the sub claim of the id_token, and that the userinfo claims are not used otherwise. The openidconnect crate implements this check, but only when an expected subject is provided, and the user_info call passed None, so the check never ran. Thread the id_token subject through to the userinfo request made during the initial code exchange, so that a mismatched response is rejected before its email/email_verified/preferred_username claims are used. The check_validity probe still passes None since no id_token is available at that point. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>pull/7463/head
2 changed files with 11 additions and 5 deletions
Loading…
Reference in new issue