google / google/GoogleSignIn-iOS

Add test coverage for the userinfo profile-fetch fallback

Open Beginner friendly
#620 0 comments 0 reactions 0 assignees View on GitHub
enhancement triage
Dominant language
Objective-C
Stars
750
Forks
282
Avg merge
2d 15h
Merged PRs (30d)
9

Description

The userinfo request in GIDSignIn.m does not have any test coverage (this is the fallback that fetches basic profile data if the ID token doesn't carry it).

Suggested changes:
- Set up a sign in whose ID token lacks profile claims, so the profile-fetch fallback runs
- Assert the userinfo request URL: scheme, host, path /oauth2/v3/userinfo, and the access_token query parameter
- Include a token containing URL-reserved characters (&, =, #). (testDisconnectNoCallback_tokenWithReservedCharacters does this to test recent changes that ensure those characters are encoded correctly)
- Assert the returned data maps correctly onto GIDProfileData

Contributor guide

Open the contributing guide

Research direction

Start with GIDSignIn.m and the existing testDisconnectNoCallback_tokenWithReservedCharacters test for setup and URL-encoding behavior. Add coverage for an ID token without profile claims, verify the /oauth2/v3/userinfo URL and encoded access_token, and confirm the response maps correctly onto GIDProfileData.

Written by the indexing model from the issue text.

Assessment

Tech stack
objective-c
Domain
authentication, mobile, testing
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.