Repository navigation
test(account): cover real Google and Apple ID token payloads - #13697
Merged
Merged
Conversation
The ID token e2e tests all mint minimal claim sets, so nothing exercised the payloads the providers actually send. Two shapes were untested: - Google's full claim set, where `azp`, `hd`, `at_hash`, `given_name`, `family_name` and `locale` ride along with the claims the flow reads, and `name` and `picture` have to reach the account and its identity. - Apple's, where `email_verified` and `is_private_email` arrive as the strings "true" rather than JSON booleans, the nonce is carried as the SHA-256 of the raw value, and no `name` or `picture` claim is ever sent, so the name falls back to the request parameter and the identity is left without a photo. `Create.php` already handles both, filter_var()-ing the string booleans and defaulting the photo to empty; this pins that behaviour down. `iss`, `aud` and `picture` stay pointed at the mock provider so the tokens verify against the mock JWKS and the avatar is fetchable in CI. Every other claim is the provider's own shape. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Contributor
|
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
Meldiron
added a commit
that referenced
this pull request
Sep 15, 2026
#13697 landed the Google- and Apple-shaped claim tests on the same tail of AccountCustomClientTest, which is the only conflict. Both sets of tests are kept: main's two shape tests and its isMockOAuth2Photo helper, followed by this branch's testCreateIdTokenSessionStoresIdToken and its findMockIdentity / decodeJwtPayload helpers. 2.2.0 maps to V25 in Migration.php, so the providerIdToken attribute stays in the migration it was added to. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
The ID token sign-in e2e tests all mint minimal claim sets (
sub,email,email_verified), so nothing exercised the payloads Google and Apple actually send. Two shapes were untested:azp,hd,at_hash,given_name,family_nameandlocaleride along with the claims the flow reads. The extras have to be carried without upsetting verification, whilenameandpicturereach the account and its identity.email_verifiedandis_private_emailarrive as the strings"true"rather than JSON booleans, the nonce is carried as the SHA-256 of the raw value, and nonameorpictureclaim is ever sent. So the name has to fall back to the request parameter (Apple hands it to the client once, on the first authorization) and the identity is left without a photo.Create.phpalready handles both — itfilter_var()s the string booleans and defaults the photo to empty — this pins that behaviour down so a future refactor can't quietly drop it. Nosrc/changes.iss,audandpicturestay pointed at the mock provider, since the tokens must verify against the mock JWKS and the avatar must be fetchable in CI. Every other claim is the provider's own shape. Apple's test runs againstmock-unverified, the mock profile that requires a nonce exactly as Apple's does.Test Plan
Both new tests run green against the existing mock OAuth2 infrastructure, and the surrounding ID token suite is unaffected:
The photo assertions cut both ways against the same helper, so they fail if the behaviour regresses in either direction: the Google payload must resolve to the mock provider's solid
#00FF00avatar, and the Apple payload must not — it has nopictureclaim, so the chain falls through to a generated avatar.composer lint(pint) passes on the changed file.Related PRs and Issues
Account/Http/Account/Sessions/IdTokenChecklist
🤖 Generated with Claude Code