ExternalUserAgent enum

Inheritance
Available extensions

Values

asWebAuthenticationSession → const ExternalUserAgent

Uses the ASWebAuthenticationSession APIs where possible.

This is the default for macOS and iOS 12 and above. On iOS 11, it will use SFAuthenticationSession instead.

Behind the scenes, the plugin makes use of the default external user-agent provided by the AppAuth iOS SDK. This will use the best user-agent available on the device. Specifically, on iOS it will use OIDExternalUserAgentIOS and on macOS it will use OIDExternalUserAgentMac.

Using this follows the best practices on using the appropriate native APIs based on the OS version.

ephemeralAsWebAuthenticationSession → const ExternalUserAgent

Indicates a preference in using an ephemeral sessions by using the ASWebAuthenticationSession APIs where possible.

This is only applicable to macOS and iOS 12 and above. On these platforms, the session will not share browser data with user's normal browser session and does not keep the cache.

Like asWebAuthenticationSession, it fallback to use SFAuthenticationSession on iOS 11 where there's no support for ephemeral sessions.

sfSafariViewController → const ExternalUserAgent

Uses the SFSafariViewController APIs.

This does not share browser data with the user's normal browser session but keeps the cache.

This is only applicable to iOS. On macOS, it will use the same behavior as asWebAuthenticationSession.

One reason for using this is when applications trigger an end session request but wants to avoid the prompt that would have appeared when the ASWebAuthenticationSession APIs are used. In this case, there's concern that the system-generated prompt would confuse the user as they are trying to sign out but the prompt states that it's taking the user through a sign-in flow.

Note that as this does not follow the best practices on using the appropriate native APIs based on the OS version, developers should use this at their own discretion.

customBrowserSafari → const ExternalUserAgent

Uses the CustomBrowserSafari factory method of OIDExternalUserAgentIOSCustomBrowser to open Safari as an external browser.

This is suitable when scenarios like using the secure browser of a MDM solution, SSO flows and using the cookies/context of the system main browser.

This is only applicable to iOS (fallback is asWebAuthenticationSession).

Note that this is undocumented but confirmed behaviour of the AppAuth iOS SDK: if Safari isn't the device's default browser, the actual default browser will be opened instead.

customBrowserChrome → const ExternalUserAgent

Uses the CustomBrowserChrome factory method of OIDExternalUserAgentIOSCustomBrowser to open Chrome as an external browser.

This is only applicable to iOS (fallback is asWebAuthenticationSession). Requires Chrome to be installed on the device, otherwise the sign in flow will fail.

Note that, like customBrowserSafari, the device's actual default browser may be opened instead of Chrome.

customBrowserFirefox → const ExternalUserAgent

Uses the CustomBrowserFirefox factory method of OIDExternalUserAgentIOSCustomBrowser to open Firefox as an external browser.

This is only applicable to iOS (fallback is asWebAuthenticationSession). Requires Firefox to be installed on the device, otherwise the sign in flow will fail.

Note that, like customBrowserSafari, the device's actual default browser may be opened instead of Firefox.

customBrowserOpera → const ExternalUserAgent

Uses the CustomBrowserOpera factory method of OIDExternalUserAgentIOSCustomBrowser to open Opera as an external browser.

This is only applicable to iOS (fallback is asWebAuthenticationSession). Requires Opera to be installed on the device, otherwise the sign in flow will fail.

Note that, like customBrowserSafari, the device's actual default browser may be opened instead of Opera.

Properties

hashCode int
The hash code for this object.
no setterinherited
index int
A numeric identifier for the enumerated value.
no setterinherited
name String

Available on Enum, provided by the EnumName extension

The name of the enum value.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

values → const List<ExternalUserAgent>
A constant List of the values in this enum, in order of their declaration.