Skip to content

Commit a17d65c

Browse files
vmichalakMaikuB
andauthored
[flutter_appauth_platform_interface] Add Prompt class to expose all prompt defined in OpenID Connect 1.0 specs (#618)
* Add `Prompt` class to expose all prompt defined in OpenID Connect 1.0 specs * apply requested API doc changes --------- Co-authored-by: Michael Bui <[email protected]>
1 parent 8b165ac commit a17d65c

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed

flutter_appauth/lib/flutter_appauth.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ export 'package:flutter_appauth_platform_interface/flutter_appauth_platform_inte
1313
FlutterAppAuthUserCancelledException,
1414
FlutterAppAuthPlatformException,
1515
GrantType,
16+
Prompt,
1617
TokenRequest,
1718
TokenResponse;
19+
1820
export 'src/flutter_appauth.dart';

flutter_appauth_platform_interface/lib/flutter_appauth_platform_interface.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@ export 'src/errors.dart';
99
export 'src/external_user_agent.dart';
1010
export 'src/flutter_appauth_platform.dart';
1111
export 'src/grant_type.dart';
12+
export 'src/prompt.dart';
1213
export 'src/token_request.dart';
1314
export 'src/token_response.dart';
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/// All spec-defined values for the OpenID Connect 1.0 `prompt` parameter.
2+
///
3+
/// See OpenID Connect Core 1.0, Section 3.1.2.1 for more information:
4+
/// https://openid.net/specs/openid-connect-core-1_0.html#rfc.section.3.1.2.1
5+
class Prompt {
6+
/// The Authorization Server MUST NOT display any authentication or consent
7+
/// user interface pages.
8+
///
9+
/// An error is returned if an End-User is not already
10+
/// authenticated or the Client does not have pre-configured consent for the
11+
/// requested Claims or does not fulfill other conditions for processing the
12+
/// request. The error code will typically be `login_required`,
13+
/// `interaction_required`, or another code defined in
14+
/// [OpenID Connect Core 1.0, Section 3.1.2.6](
15+
/// https://openid.net/specs/openid-connect-core-1_0.html#rfc.section.3.1.2.6).
16+
/// This can be used as a method to check for existing authentication and/or
17+
/// consent.
18+
static const String none = 'none';
19+
20+
/// The Authorization Server SHOULD prompt the End-User for re-authentication.
21+
///
22+
/// If it cannot re-authenticate the End-User, it MUST return an error,
23+
/// typically `login_required`.
24+
static const String login = 'login';
25+
26+
/// The Authorization Server SHOULD prompt the End-User for consent before
27+
/// returning information to the Client.
28+
///
29+
/// If it cannot obtain consent, it MUST
30+
/// return an error, typically `consent_required`.
31+
static const String consent = 'consent';
32+
33+
/// The Authorization Server SHOULD prompt the End-User to select a user
34+
/// account.
35+
///
36+
/// This enables an End-User who has multiple accounts at the
37+
/// Authorization Server to select amongst the multiple accounts that they
38+
/// might have current sessions for. If it cannot obtain an account selection
39+
/// choice made by the End-User, it MUST return an error, typically
40+
/// `account_selection_required`.
41+
static const String selectAccount = 'select_account';
42+
}

0 commit comments

Comments
 (0)