Skip to content

Conversation

@AkshatG6
Copy link
Contributor

@AkshatG6 AkshatG6 commented Oct 7, 2025

This PR addresses a runtime crash that occurs when the dictionary returned by additionalTokenRefreshParametersForAuthSession: contains non-string values, leading to a type mismatch in GTMAppAuth.

This fix is implemented in GIDEMMSupport by iterating through the additionalParameters dictionary and converts values to strings with the following logic :-

  1. NSString values: Preserves them as-is.
  2. NSNumber values: Converts booleans to their string representation ("true" or "false") and all other numbers to their standard string value.
  3. NSArray and NSDictionary values: Serializes them into a single, compact JSON string.

This ensures that the dictionary returned to GTMAppAuth is always of the correct type.

This pull request introduces the `GIDTokenClaimsInternalOptions` class, a new component designed to handle the validation and JSON serialization of token claims.

Key changes:

* Adds the `GIDTokenClaimsInternalOptions` class to validate the token claims and return a JSON object.
* Adds the `GIDJSONSerializer` protocol with real and fake implementations to support serializing the token claims.
* Provides unit tests to validate the implementation.
@AkshatG6 AkshatG6 closed this Oct 7, 2025
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.

1 participant