FlutterWebAuth2Options class
Provides configuration options for calls to authenticate
.
Constructors
-
FlutterWebAuth2Options({bool? preferEphemeral, String? debugOrigin, int? intentFlags, String? windowName, int? timeout, String? landingPageHtml, bool? silentAuth, bool? useWebview, String? httpsHost, String? httpsPath, List<
String> ? customTabsPackageOrder}) -
Construct an instance and specify the wanted options.
const
-
FlutterWebAuth2Options.fromJson(Map<
String, dynamic> json) - Construct an instance from JSON format.
Properties
-
customTabsPackageOrder
→ List<
String> ? -
Only has an effect on Android!
Sets the Android browser priority for opening custom tabs.
Needs to be a list of packages providing a custom tabs
service. If a browser is not installed, the next on the list
is tested etc.
final
- debugOrigin → String?
-
Only has an effect on Web!
Can be used to override the origin of the redirect URL.
This is useful for cases where the redirect URL is not on the same
domain (e.g. local testing).
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- httpsHost → String?
-
Only has an effect on iOS and MacOS!
String specifying the host of the URL that the page will redirect to
upon successful authentication (callback URL).
When
callbackUrlScheme
ishttps
, this must be specified on Apple devices running iOS >= 17.4 or macOS >= 14.4.final - httpsPath → String?
-
Only has an effect on iOS and MacOS!
String specifying the path of the URL that the page will redirect to
upon successful authentication (callback URL).
When
callbackUrlScheme
ishttps
, this must be specified on Apple devices running iOS >= 17.4 or macOS >= 14.4.final - intentFlags → int
-
Only has an effect on Android!
Can be used to configure the intent flags for the custom tabs intent.
Possible values can be found
here
or by using the flags from the
Flag
class from android_intent_plus. Use ephemeralIntentFlags if you want similar behaviour to preferEphemeral on Android. For Apple devices, see preferEphemeral.final - landingPageHtml → String
-
Only has an effect on Linux and Windows!
Can be used to customise the landing page which tells the user that the
authentication was successful. It is the literal HTML source code which
will be displayed using a
HttpServer
.final - preferEphemeral → bool
-
Only has an effect on iOS and MacOS!
If this is
true
, an ephemeral web browser session will be used where possible (prefersEphemeralWebBrowserSession
). For Android devices, see intentFlags.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- silentAuth → bool
-
Only has an effect on Web!
When set to
true
, the authentication URL will be loaded in a hiddeniframe
instead of opening a new window or tab. This is primarily used for silent authentication processes where a full-page redirect is not desirable. It allows for a seamless user experience by performing the authentication in the background. This approach is useful for token refreshes or for maintaining user sessions without explicit user interaction. IT IS YOUR RESPONSIBILITY TO MAKE SURE THAT THE URL IS SANE AND DOES NOT CAUSE ANY HARM. IFRAMES CAN BE EXPLOITED IN MANY WAYS BY MALICIOUS ATTACKERS!final - timeout → int
-
Only has an effect on Linux, Web and Windows!
Can be used to specify a timeout in seconds when the authentication shall
be deemed unsuccessful. An error will be thrown in order to abort the
authentication process.
final
- useWebview → bool
-
Only has an effect on Linux and Windows!
When set to
true
, use the new Webview implementation. When set tofalse
, the old approach using an internal server is being used in order to fetch the HTTP result. When using the internal server, please keep in mind that you cannot choose any callback URL scheme, as described in https://github.com/ThexXTURBOXx/flutter_web_auth_2/issues/25final - windowName → String?
-
Only has an effect on Web!
Can be used to pass a window name for the URL open call.
See here for
possible parameter values.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Convert this instance to JSON format.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited