Skip to content

Commit 2096152

Browse files
committed
apply additionalQueryAPrameters everywhere
1 parent 03ae0e9 commit 2096152

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

Sources/OAuth2Client/NXOAuth2Account.m

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ - (NXOAuth2Client *)oauthClient;
8181
NSURL *authorizeURL = [configuration objectForKey:kNXOAuth2AccountStoreConfigurationAuthorizeURL];
8282
NSURL *tokenURL = [configuration objectForKey:kNXOAuth2AccountStoreConfigurationTokenURL];
8383
NSString *tokenType = [configuration objectForKey:kNXOAuth2AccountStoreConfigurationTokenType];
84-
84+
NSDictionary *additionalQueryParams = [configuration objectForKey:kNXOAuth2AccountStoreConfigurationAdditionalAuthenticationParameters];
85+
8586
oauthClient = [[NXOAuth2Client alloc] initWithClientID:clientID
8687
clientSecret:clientSecret
8788
authorizeURL:authorizeURL
@@ -90,6 +91,10 @@ - (NXOAuth2Client *)oauthClient;
9091
tokenType:tokenType
9192
persistent:NO
9293
delegate:self];
94+
if (additionalQueryParams) {
95+
oauthClient.additionalAuthenticationParameters = additionalQueryParams;
96+
}
97+
9398
}
9499
}
95100
return oauthClient;

Sources/OAuth2Client/NXOAuth2Client.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,11 @@ - (void)requestTokenWithAuthGrant:(NSString *)authGrant redirectURL:(NSURL *)red
321321
if (self.desiredScope) {
322322
[parameters setObject:[[self.desiredScope allObjects] componentsJoinedByString:@" "] forKey:@"scope"];
323323
}
324+
325+
if (self.additionalAuthenticationParameters) {
326+
[parameters addEntriesFromDictionary:self.additionalAuthenticationParameters];
327+
}
328+
324329
authConnection = [[NXOAuth2Connection alloc] initWithRequest:tokenRequest
325330
requestParameters:parameters
326331
oauthClient:self

0 commit comments

Comments
 (0)