Skip to content

Commit 03ae0e9

Browse files
committed
raise excpetion in case of invalid keys
1 parent 2706f9c commit 03ae0e9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Sources/OAuth2Client/NXOAuth2Client.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,11 @@ - (void)setAdditionalAuthenticationParameters:(NSDictionary *)value;
121121
@"assertion_type", @"assertion" ];
122122

123123
for (id key in value) {
124-
NSAssert1([forbiddenKeys containsObject:key] == NO, @"The key %@ may not be used in additionalAuthenticationParameters", key);
124+
if ([forbiddenKeys containsObject:key]) {
125+
[[NSException exceptionWithName:NSInvalidArgumentException
126+
reason:[NSString stringWithFormat:@"'%@' is not allowed as a key for additionalAuthenticationParameters", key]
127+
userInfo:nil] raise];
128+
}
125129
}
126130

127131
additionalAuthenticationParameters = value;

0 commit comments

Comments
 (0)