You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[GIDEMMSupport updatedEMMParametersWithParameters:
authSession.authState.lastTokenResponse.additionalParameters] , There are cases where the value returned by this method does not meet the required type
Hi! Looking for more context. Would you happen to know what the type(s) of the value you're getting is? Do you have any guesses on what cases specifically may return a different type?
The fix #559 by @brnnmrls will still crash if emmSupport is disabled, because the dictionary passed in that is returned in if emmSupport is null can have the "refresh_token_expires_in" = long_value in it:
Hi, this issue is fixed in Google Sign-In iOS SDK version 9.1.0.
Title: GIDEMMSupport can still return non-string additional token refresh parameters from lastTokenResponse.additionalParameters
Environment
GoogleSignIn: 9.1.0
AppAuth: 2.0.0
GTMAppAuth: 5.0.0
Platform: iOS
Problem
GIDEMMSupport appears to have added filtering via dictionaryWithStringValuesFromDictionary: to ensure EMM parameters are returned as NSDictionary<NSString *, NSString *>.
However, this does not fully cover the case where no emm_support value exists.
Current flow:
- (nullable NSDictionary<NSString *,NSString *> *)
additionalTokenRefreshParametersForAuthSession:(GTMAuthSession *)authSession {
return [GIDEMMSupport updatedEMMParametersWithParameters:
authSession.authState.lastTokenResponse.additionalParameters];
}
Then:
+ (NSDictionary<NSString *,NSString *> *)parametersWithParameters:(NSDictionary *)parameters
emmSupport:(nullable NSString *)emmSupport
isPasscodeInfoRequired:(BOOL)isPasscodeInfoRequired {
if (!emmSupport) {
return parameters;
}
NSMutableDictionary *allParameters = [(parameters ?: @{}) mutableCopy];
...
return [GIDEMMSupport dictionaryWithStringValuesFromDictionary:allParameters];
}
When emmSupport is nil, the method returns parameters directly. But authSession.authState.lastTokenResponse.additionalParameters comes from OIDTokenResponse.additionalParameters, whose type is not guaranteed to be NSDictionary<NSString *, NSString *>; it may contain non-string JSON values such as dictionaries, arrays, booleans, numbers, or null-like values.
As a result, additionalTokenRefreshParametersForAuthSession: can still return a dictionary containing non-string values, despite its declared return type being:
NSDictionary<NSString *, NSString *> *
Expected Behavior
updatedEMMParametersWithParameters: / parametersWithParameters:emmSupport:isPasscodeInfoRequired: should always return a string-only dictionary, including the early-return path where emmSupport is nil.
Suggested Fix
Change:
if (!emmSupport) {
return parameters;
}
to:
if (!emmSupport) {
return [GIDEMMSupport dictionaryWithStringValuesFromDictionary:(parameters ?: @{})];
}
This makes the behavior consistent with the later return path and prevents non-string values from being returned through the GTMAuthSessionDelegate additional token refresh parameters API.
Activity
brnnmrls commentedon Mar 4, 2025
Hi! Looking for more context. Would you happen to know what the type(s) of the value you're getting is? Do you have any guesses on what cases specifically may return a different type?
aforkalyuk commentedon Mar 6, 2025
additionalTokenRefreshParameters must return [String: String]?, but in
[GIDEMMSupport updatedEMMParametersWithParameters: authSession.authState.lastTokenResponse.additionalParameters]authSession.authState.lastTokenResponse.additionalParameters =
{
"refresh_token_expires_in" = 604799;
}
onewOne commentedon Jul 10, 2025
Unreviewed apps with scope for login will have this issue.
App review doesn't crash.
My guess is that the scope authorization for unaudited apps has an expiration time, but this time is not officially handled as a string type.
Aloisius commentedon Oct 20, 2025
The fix #559 by @brnnmrls will still crash if emmSupport is disabled, because the dictionary passed in that is returned in if emmSupport is null can have the "refresh_token_expires_in" = long_value in it:
Changing this to
return [GIDEMMSupport dictionaryWithStringValuesFromDictionary:parameters]instead fixes it.AkshatG6 commentedon Jan 15, 2026
Hi, this issue is fixed in Google Sign-In iOS SDK version
9.1.0.onewOne commentedon Jun 4, 2026
Title: GIDEMMSupport can still return non-string additional token refresh parameters from lastTokenResponse.additionalParameters
Environment
Problem
GIDEMMSupportappears to have added filtering viadictionaryWithStringValuesFromDictionary:to ensure EMM parameters are returned asNSDictionary<NSString *, NSString *>.However, this does not fully cover the case where no
emm_supportvalue exists.Current flow: