Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[various] extract error_uri via AppAuth iOS SDK #517

Merged
merged 2 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions flutter_appauth/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 7.0.0-dev.2

* The `errorUri` property of the `FlutterAppAuthPlatformErrorDetails` class will now be populated on iOS/maCOS if available

# 7.0.0-dev.1

* **Breaking change** Bumped minimum Flutter and Dart SDK constraints to 3.13.0 and 3.1.0 respectively
Expand Down
11 changes: 7 additions & 4 deletions flutter_appauth/ios/Classes/FlutterAppAuth.m
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,14 @@ + (void)finishWithError:(NSString *)errorCode message:(NSString *)message result
NSDictionary<NSString *, id> *authErrorMap = [authError isKindOfClass:[NSDictionary class]] ? authError : nil;

if (authErrorMap) {
if ([authErrorMap objectForKey:@"error"]) {
[details setObject:authErrorMap[@"error"] forKey:@"error"];
if ([authErrorMap objectForKey:OIDOAuthErrorFieldError]) {
[details setObject:authErrorMap[OIDOAuthErrorFieldError] forKey:OIDOAuthErrorFieldError];
}
if ([authErrorMap objectForKey:@"error_description"]) {
[details setObject:authErrorMap[@"error_description"] forKey:@"error_description"];
if ([authErrorMap objectForKey:OIDOAuthErrorFieldErrorDescription]) {
[details setObject:authErrorMap[OIDOAuthErrorFieldErrorDescription] forKey:OIDOAuthErrorFieldErrorDescription];
}
if ([authErrorMap objectForKey:OIDOAuthErrorFieldErrorURI]) {
[details setObject:authErrorMap[OIDOAuthErrorFieldErrorURI] forKey:OIDOAuthErrorFieldErrorURI];
}
}
if (error.domain) {
Expand Down
4 changes: 2 additions & 2 deletions 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: 7.0.0-dev.1
version: 7.0.0-dev.2
homepage: https://github.com/MaikuB/flutter_appauth/tree/master/flutter_appauth

environment:
Expand All @@ -10,7 +10,7 @@ environment:
dependencies:
flutter:
sdk: flutter
flutter_appauth_platform_interface: ^7.0.0-dev.1
flutter_appauth_platform_interface: ^7.0.0-dev.2

flutter:
plugin:
Expand Down
4 changes: 4 additions & 0 deletions flutter_appauth_platform_interface/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [7.0.0-dev.2]

* Updated API docs for `FlutterAppAuthPlatformErrorDetails`'s `errorUri` property as this can now be returned on iOS/macOS

## [7.0.0-dev.1]

* **Breaking change** Bumped minimum Flutter and Dart SDK constraints to 3.13.0 and 3.1.0 respectively
Expand Down
2 changes: 0 additions & 2 deletions flutter_appauth_platform_interface/lib/src/errors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ class FlutterAppAuthPlatformErrorDetails {
///
/// Corresponds to the `error_uri` parameter defined in the OAuth 2.0
/// framework [here](https://datatracker.ietf.org/doc/html/rfc6749#section-5.2)
///
/// Only populated on Android.
final String? errorUri;

/// Error domain from the AppAuth iOS SDK.
Expand Down
2 changes: 1 addition & 1 deletion flutter_appauth_platform_interface/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_appauth_platform_interface
description: A common platform interface for the flutter_appauth plugin.
version: 7.0.0-dev.1
version: 7.0.0-dev.2
homepage: https://github.com/MaikuB/flutter_appauth/tree/master/flutter_appauth_platform_interface

environment:
Expand Down
Loading