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] added FlutterAppAuthOAuthError to hold standard error codes that apps can reference #523

Merged
merged 1 commit into from
Aug 10, 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
1 change: 1 addition & 0 deletions flutter_appauth/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* **Breaking change** all methods have now been made to return non-nullable types
* [Android] updated plugin to specify `Theme.AppCompat.Translucent.NoTitleBar` as the theme for the `RedirectUriReceiverActivity` from the AppAuth Android SDK. This is to fix a crash raised with issues [#362](https://github.com/MaikuB/flutter_appauth/issues/362) and [#515](https://github.com/MaikuB/flutter_appauth/issues/515)
* [iOS][macOS] bumped AppAuth iOS dependency to 1.7.5
* Added `FlutterAppAuthOAuthError` class that contains string constants representing OAuth 2.0 error codes defined by the [specification](https://datatracker.ietf.org/doc/html/rfc6749#section-5.2).
* Updated API docs with more details
* Updated readme with more details on essential knowledge and links to OAuth 2.0 specifications

Expand Down
1 change: 1 addition & 0 deletions flutter_appauth_platform_interface/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

* **Breaking change** all methods have now been made to return non-nullable types
* Updated API docs with more details
* Added `FlutterAppAuthOAuthError` class that contains string constants representing OAuth 2.0 error codes defined by the [specification](https://datatracker.ietf.org/doc/html/rfc6749#section-5.2).

## [7.0.0-dev.2]

Expand Down
21 changes: 21 additions & 0 deletions flutter_appauth_platform_interface/lib/src/errors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ class FlutterAppAuthPlatformErrorDetails {
/// For 400 errors from the authorization server, this is corresponds to the
/// `error` parameter as defined in the OAuth 2.0 framework [here](https://datatracker.ietf.org/doc/html/rfc6749#section-5.2).
/// Otherwise a short error describing what happened.
///
/// The [FlutterAppAuthOAuthError] class contains string constants for
/// the standard error codes that could used by applications to determine the
/// nature of the error.
///
/// Note that authorization servers may return custom error codes that are not
/// defined in the OAuth 2.0 framework.
final String? error;

/// Short, human readable error description.
Expand Down Expand Up @@ -133,3 +140,17 @@ class FlutterAppAuthPlatformException extends PlatformException {
/// Details of the error from the underlying platform's AppAuth SDK.
final FlutterAppAuthPlatformErrorDetails platformErrorDetails;
}

/// Represents OAuth error codes that can be returned by the authorization
/// server.
///
/// These are the standard error codes defined in the OAuth 2.0 framework
/// [here](https://datatracker.ietf.org/doc/html/rfc6749#section-5.2).
class FlutterAppAuthOAuthError {
static const String invalidRequest = 'invalid_request';
static const String invalidClient = 'invalid_client';
static const String invalidGrant = 'invalid_grant';
static const String unauthorizedClient = 'unauthorized_client';
static const String unsupportedGrantType = 'unsupported_grant_type';
static const String invalidScope = 'invalid_scope';
}
Loading