Skip to content

Commit

Permalink
fix parsing of nonce from auth response on iOS (#332)
Browse files Browse the repository at this point in the history
  • Loading branch information
MaikuB authored May 17, 2022
1 parent e28fdd9 commit b602242
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 4 additions & 0 deletions flutter_appauth/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 3.0.1

* [iOS] fix `nonce` not being returned correctly on iOS

## 3.0.0

* **Breaking change** `AuthorizationResponse`'s constructor now includes `nonce` and has changed to take positional parameters
Expand Down
10 changes: 3 additions & 7 deletions flutter_appauth/ios/Classes/FlutterAppauthPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ - (void)performAuthorization:(OIDServiceConfiguration *)serviceConfiguration cli
[processedResponse setObject:authorizationResponse.additionalParameters forKey:@"authorizationAdditionalParameters"];
[processedResponse setObject:authorizationResponse.authorizationCode forKey:@"authorizationCode"];
[processedResponse setObject:authorizationResponse.request.codeVerifier forKey:@"codeVerifier"];
[processedResponse setObject:authorizationResponse.request.nonce forKey:@"nonce"];
result(processedResponse);
} else {
[self finishWithError:AUTHORIZE_ERROR_CODE message:[self formatMessageWithError:AUTHORIZE_ERROR_MESSAGE_FORMAT error:error] result:result];
Expand Down Expand Up @@ -381,13 +382,8 @@ - (NSMutableDictionary *)processResponses:(OIDTokenResponse*) tokenResponse auth
if(tokenResponse.accessTokenExpirationDate) {
[processedResponses setValue:[[NSNumber alloc] initWithDouble:[tokenResponse.accessTokenExpirationDate timeIntervalSince1970] * 1000] forKey:@"accessTokenExpirationTime"];
}
if(authResponse) {
if (authResponse.additionalParameters) {
[processedResponses setObject:authResponse.additionalParameters forKey:@"authorizationAdditionalParameters"];
}
if (authResponse.request && authResponse.request.nonce) {
[processedResponses setObject:authResponse.request.nonce forKey:@"nonce"];
}
if(authResponse && authResponse.additionalParameters) {
[processedResponses setObject:authResponse.additionalParameters forKey:@"authorizationAdditionalParameters"];
}
if(tokenResponse.additionalParameters) {
[processedResponses setObject:tokenResponse.additionalParameters forKey:@"tokenAdditionalParameters"];
Expand Down
2 changes: 1 addition & 1 deletion flutter_appauth/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_appauth
description: This plugin provides an abstraction around the Android and iOS AppAuth SDKs so it can be used to communicate with OAuth 2.0 and OpenID Connect providers
version: 3.0.0
version: 3.0.1
homepage: https://github.com/MaikuB/flutter_appauth/tree/master/flutter_appauth

environment:
Expand Down

0 comments on commit b602242

Please sign in to comment.